Skip to main content

Transformation functions

map

Commentary

added in 0.1.20

Generates a map of n key/value pairs. Duplicate keys will collapse and defer to the latest invocations.


Examples

Generating key/value pairs

{
"_gen": "map",
"key": {
"_gen": "uuid"
},
"value": {
"_gen": "boolean"
},
"n": 5
}
[
{
"86920655-99d2-63f8-e9f2-0b92eed0e7bb": true,
"f75caf9c-ba51-5e74-9f73-63139313815f": true,
"b2219e42-6e0d-ea41-e2fc-23700f07fc7a": false,
"64950a0b-a786-1f99-11ea-9e541cf1655e": true,
"b84118ce-ea92-3aa8-577e-21a333c23b76": true
},
{
"902020e2-73d7-b0ab-8fcb-a2083cbc150a": true,
"40564e88-6ab8-d168-18db-b4248f65985e": false,
"19aaec98-0e39-87a2-9c5f-c104ad4f8ff4": false,
"c75f2e1c-08a1-2ee8-a852-94d42deee42c": false,
"ff599795-2599-2790-bdd4-86993e59b78e": true
},
{
"32cd8a9f-51a2-85b3-b4cc-88f9a1ca0d37": true,
"ba467ad8-d126-8df0-075c-319c5d104b7a": false,
"0222c943-6275-deb5-e6fe-ed16d95116a7": true,
"82ec1b7a-61ac-8b8f-d019-5bf72f8257fc": false,
"e3a27ef4-8cc8-1fed-3131-979a032000cf": true
}
]

Specification

JSON schema

{
"type": "object",
"properties": {
"key": {},
"value": {},
"n": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"_gen": {
"type": "string"
}
},
"required": [
"_gen"
]
}
]
}
}
}