$recursiveRef example demonstrating dynamic nature of the resolution scope
..as discussed in
"valid": false
}
]
+ },
+ {
+ "description": "multiple dynamic paths to the $recursiveRef keyword",
+ "schema": {
+ "$id": "recursiveRef8_main.json",
+ "$defs": {
+ "inner": {
+ "$id": "recursiveRef8_inner.json",
+ "$recursiveAnchor": true,
+ "title": "inner",
+ "additionalProperties": {
+ "$recursiveRef": "#"
+ }
+ }
+ },
+ "if": {
+ "propertyNames": {
+ "pattern": "^[a-m]"
+ }
+ },
+ "then": {
+ "title": "any type of node",
+ "$id": "recursiveRef8_anyLeafNode.json",
+ "$recursiveAnchor": true,
+ "$ref": "recursiveRef8_main.json#/$defs/inner"
+ },
+ "else": {
+ "title": "integer node",
+ "$id": "recursiveRef8_integerNode.json",
+ "$recursiveAnchor": true,
+ "type": [ "object", "integer" ],
+ "$ref": "recursiveRef8_main.json#/$defs/inner"
+ }
+ },
+ "tests": [
+ {
+ "description": "recurse to anyLeafNode - floats are allowed",
+ "data": { "alpha": 1.1 },
+ "valid": true
+ },
+ {
+ "description": "recurse to integerNode - floats are not allowed",
+ "data": { "november": 1.1 },
+ "valid": false
+ }
+ ]
}
]
