-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
The following schemas should produce the same output on the test.json file:
test1.schema.json:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"key": {
"anyOf": [
{
"type": "string",
"const": "unused literal"
},
{
"type": "string",
"const": "text value",
"deprecated": true
}
]
}
}
}test2.schema.json:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"key": {
"anyOf": [
{
"type": "string",
"const": "unused literal"
},
{
"type": "string",
"pattern": "^text value$",
"deprecated": true
}
]
}
}
}test.json:
{
"key": "text value"
}However, using test2.schema.json shows Value is not accepted. Valid values: "unused literal". on hover instead of the expected Value is deprecated that it shows for test1.schema.json.
This means that the text "text value" did not match the pattern "^text value$", which it should... (and does when "deprecated": true is removed)
Note that this example seems to be minimal: removing the non-deprecated branch of the anyOf leads to different (and correct) results, for example
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
