Skip to content

added test to illustrate $ref defining a new scope #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/draft2019-09/ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,5 +357,30 @@
"valid": false
}
]
},
{
"description": "ref creates new scope when adjacent to keywords",
"schema": {
"$defs": {
"A": {
"unevaluatedProperties": false
}
},
"properties": {
"prop1": {
"type": "string"
}
},
"$ref": "#/$defs/A"
},
"tests": [
{
"description": "referenced subschema doesn't see annoations from properties",
"data": {
"prop1": "match"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $ref were resolved as a literal in-place substitution, then prop1 would be allowed.

},
"valid": false
}
]
}
]