dynamic $recursiveRef test with cousin $recursiveAnchors
"valid": false
}
]
+ },
+ {
+ "description": "dynamic $recursiveRef destination (not predictable at schema compile time)",
+ "schema": {
+ "$id": "main.json",
+ "$defs": {
+ "inner": {
+ "$id": "inner.json",
+ "$recursiveAnchor": true,
+ "title": "inner",
+ "additionalProperties": {
+ "$recursiveRef": "#"
+ }
+ }
+
+ },
+ "if": { "propertyNames": { "pattern": "^[a-m]" } },
+ "then": {
+ "title": "any type of node",
+ "$id": "anyLeafNode.json",
+ "$recursiveAnchor": true,
+ "$ref": "main.json#/$defs/inner"
+ },
+ "else": {
+ "title": "integer node",
+ "$id": "integerNode.json",
+ "$recursiveAnchor": true,
+ "type": [ "object", "integer" ],
+ "$ref": "main.json#/$defs/inner"
+ }
+ },
+ "tests": [
+ {
+ "description": "numeric node",
+ "data": { "alpha": 1.1 },
+ "valid": true
+ },
+ {
+ "description": "integer node",
+ "data": { "november": 1.1 },
+ "valid": false
+ }
+ ]
}
]
