Skip to content

Commit 4cb100a

Browse files
Merge pull request #465 from json-schema-org/ether/more-naive-ref
add another test of naive $ref replacement
2 parents f858c61 + 31dc86b commit 4cb100a

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

tests/draft2019-09/ref.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,15 @@
420420
},
421421
"tests": [
422422
{
423-
"description": "do not evaluate the $ref inside the enum",
423+
"description": "do not evaluate the $ref inside the enum, matching any string",
424424
"data": "this is a string",
425425
"valid": false
426426
},
427+
{
428+
"description": "do not evaluate the $ref inside the enum, definition exact match",
429+
"data": { "type": "string" },
430+
"valid": false
431+
},
427432
{
428433
"description": "match the enum exactly",
429434
"data": { "$ref": "#/$defs/a_string" },

tests/draft2020-12/ref.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,15 @@
422422
},
423423
"tests": [
424424
{
425-
"description": "do not evaluate the $ref inside the enum",
425+
"description": "do not evaluate the $ref inside the enum, matching any string",
426426
"data": "this is a string",
427427
"valid": false
428428
},
429+
{
430+
"description": "do not evaluate the $ref inside the enum, definition exact match",
431+
"data": { "type": "string" },
432+
"valid": false
433+
},
429434
{
430435
"description": "match the enum exactly",
431436
"data": { "$ref": "#/$defs/a_string" },

tests/draft3/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
},
229229
"tests": [
230230
{
231-
"description": "do not evaluate the $ref inside the enum",
231+
"description": "do not evaluate the $ref inside the enum, matching any string",
232232
"data": "this is a string",
233233
"valid": false
234234
},

tests/draft4/ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
},
448448
"tests": [
449449
{
450-
"description": "do not evaluate the $ref inside the enum",
450+
"description": "do not evaluate the $ref inside the enum, matching any string",
451451
"data": "this is a string",
452452
"valid": false
453453
},

tests/draft6/ref.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,15 @@
479479
},
480480
"tests": [
481481
{
482-
"description": "do not evaluate the $ref inside the enum",
482+
"description": "do not evaluate the $ref inside the enum, matching any string",
483483
"data": "this is a string",
484484
"valid": false
485485
},
486+
{
487+
"description": "do not evaluate the $ref inside the enum, definition exact match",
488+
"data": { "type": "string" },
489+
"valid": false
490+
},
486491
{
487492
"description": "match the enum exactly",
488493
"data": { "$ref": "#/definitions/a_string" },

tests/draft7/ref.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,15 @@
479479
},
480480
"tests": [
481481
{
482-
"description": "do not evaluate the $ref inside the enum",
482+
"description": "do not evaluate the $ref inside the enum, matching any string",
483483
"data": "this is a string",
484484
"valid": false
485485
},
486+
{
487+
"description": "do not evaluate the $ref inside the enum, definition exact match",
488+
"data": { "type": "string" },
489+
"valid": false
490+
},
486491
{
487492
"description": "match the enum exactly",
488493
"data": { "$ref": "#/definitions/a_string" },

0 commit comments

Comments
 (0)