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
}
[
{
"3b969c93-07cb-1f15-cb68-4266eb6dd2e7": false,
"4b45da8f-51b9-1092-77f6-c1092c203652": true,
"62faaba8-cf91-2440-a66a-c76626d68ac4": false,
"ef454a61-9a87-9aa7-7ca3-a060378f5f5f": true,
"bf7ccf0a-2fb9-7242-a811-3386ca2c393f": true
},
{
"448f6772-019c-da32-2557-7f6530730008": false,
"71618ae8-996c-79b1-351b-f4e13a6b4f06": false,
"d6a322f0-2503-f21c-df26-a5c827d44018": false,
"cdca3d57-8914-7639-6dfc-f4c232d6f3ec": false,
"a5af8ea8-49c6-d4e6-553c-45b3e528ce89": true
},
{
"0fed2443-9479-996b-659a-0ef849ce9d84": true,
"5b0c8307-e43f-4fa7-4c2e-e1327c2a5b6b": true,
"55454546-83f7-218a-68ed-51d85ef45277": true,
"a469d3f6-0b6b-1053-30a9-439bf417fcb8": true,
"6fc11c55-edde-10b5-2549-4748602da952": true
}
]

Specification

JSON schema

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