Skip to content

Commit f059435

Browse files
authored
Merge pull request #327 from json-schema-org/ref-scoping
added test to illustrate $ref defining a new scope
2 parents 3379127 + 2693322 commit f059435

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/draft2019-09/ref.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,5 +357,30 @@
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+
"description": "referenced subschema doesn't see annoations from properties",
379+
"data": {
380+
"prop1": "match"
381+
},
382+
"valid": false
383+
}
384+
]
360385
}
361386
]

0 commit comments

Comments
 (0)