| 1 |
[ |
| 2 |
{ |
| 3 |
"description": "dynamic $dynamicRef destination (not predictable at schema compile time)", |
| 4 |
"schema": { |
| 5 |
"$id": "main.json", |
| 6 |
"$defs": { |
| 7 |
"inner": { |
| 8 |
"$id": "inner.json", |
| 9 |
"$dynamicAnchor": "hello", |
| 10 |
"title": "inner", |
| 11 |
"additionalProperties": { |
| 12 |
"$dynamicRef": "#hello" |
| 13 |
} |
| 14 |
} |
| 15 |
}, |
| 16 |
"if": { "propertyNames": { "pattern": "^[a-m]" } }, |
| 17 |
"then": { |
| 18 |
"title": "any type of node", |
| 19 |
"$id": "anyLeafNode.json", |
| 20 |
"$dynamicAnchor": "hello", |
| 21 |
"$ref": "main.json#/$defs/inner" |
| 22 |
}, |
| 23 |
"else": { |
| 24 |
"title": "integer node", |
| 25 |
"$id": "integerNode.json", |
| 26 |
"$dynamicAnchor": "hello", |
| 27 |
"type": [ "object", "integer" ], |
| 28 |
"$ref": "main.json#/$defs/inner" |
| 29 |
} |
| 30 |
}, |
| 31 |
"tests": [ |
| 32 |
{ |
| 33 |
"description": "numeric node", |
| 34 |
"data": { "alpha": 1.1 }, |
| 35 |
"valid": true |
| 36 |
}, |
| 37 |
{ |
| 38 |
"description": "integer node", |
| 39 |
"data": { "november": 1.1 }, |
| 40 |
"valid": false |
| 41 |
} |
| 42 |
] |
| 43 |
} |
| 44 |
] |