Skip to content

Commit 546b356

Browse files
committed
test for $ref with $recursiveAnchor
1 parent 57617f2 commit 546b356

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

tests/draft2019-09/ref.json

+39-1
Original file line numberDiff line numberDiff line change
@@ -1048,5 +1048,43 @@
10481048
"valid": false
10491049
}
10501050
]
1051-
}
1051+
},
1052+
{
1053+
"description": "$ref with $recursiveAnchor",
1054+
"schema": {
1055+
"$schema": "https://json-schema.org/draft/2019-09/schema",
1056+
"$id": "https://example.com/schemas/array-without-unevaluatedItems",
1057+
"$ref": "/schemas/array-with-unevaluatedItems",
1058+
"$recursiveAnchor": true,
1059+
"unevaluatedItems": false,
1060+
"$defs": {
1061+
"/schemas/array-with-unevaluatedItems": {
1062+
"$schema": "https://json-schema.org/draft/2019-09/schema",
1063+
"$id": "/schemas/array-with-unevaluatedItems",
1064+
"$recursiveAnchor": true,
1065+
"type": "array",
1066+
"items": [
1067+
{
1068+
"type": "string"
1069+
},
1070+
{
1071+
"$ref": "#"
1072+
}
1073+
]
1074+
}
1075+
}
1076+
},
1077+
"tests": [
1078+
{
1079+
"description": "extra items allowed for inner arrays",
1080+
"data" : ["foo",["bar" , [] , 8]],
1081+
"valid": true
1082+
},
1083+
{
1084+
"description": "extra items disallowed for root",
1085+
"data" : ["foo",["bar" , [] , 8], 8],
1086+
"valid": false
1087+
}
1088+
]
1089+
}
10521090
]

0 commit comments

Comments
 (0)