Skip to content

Commit 2d0ce04

Browse files
committed
added test to illustrate $ref defining a new scope
1 parent 3379127 commit 2d0ce04

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/draft2019-09/ref.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,5 +357,28 @@
357357
"valid": false
358358
}
359359
]
360+
},
361+
{
362+
"description": "ref creates new scope when adjacent to keywords",
363+
"schema": {
364+
"$defs": {
365+
"A": {
366+
"unevaluatedProperties": false
367+
}
368+
},
369+
"properties": {
370+
"prop1": {
371+
"type": "string"
372+
}
373+
},
374+
"$ref": "#/$defs/A"
375+
},
376+
"tests": [
377+
{
378+
"prop1": "match",
379+
"prop2": 1,
380+
"valid": true
381+
}
382+
]
360383
}
361384
]

0 commit comments

Comments
 (0)