Rx: Simple, Extensible Schemata
//all
//all will only accept values accepted by every schema given in a list.
Match integers between 3 and 18:
{
"type": "//all",
"of": [
{ "type": "//num", "range": { "min-ex": 0, "max": 18 } },
{ "type": "//num", "range": { "min": 3 } },
"//int",
]
}
/.meta/all, the schema for //all definitions:
{
"type": "//rec",
"required": {
"type": { "type": "//str", "value": "//all" },
"of": {
"type": "//arr",
"contents": "/.meta/schema",
"length": { "min": 1 }
}
}
}