json.enum
A convenience stream built with core.select that exists to support the JSON Schema enum keyword. If a stream does not have atype, but does include the enum attribute,json.enum will be inferred.
Attributes
enumrequiredAn array of JSON values to be emitted, selected at random.
Examples
Consider this stream definition, which is also valid JSON Schema:
{
"enum": [41, { "name": "Jim" }]
}It is inferred to be:
{
"type": "json.enum",
"enum": [41, { "name": "Jim" }]
}Which is implemented as:
{
"type": "core.select",
"options": [
{
"weight": 1,
"stream": {
"type": "core.constant",
"value": 41
}
},
{
"weight": 1,
"stream": {
"type": "core.constant",
"value": { "name": "Jim" }
}
}
]
}