-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
[json] $ref breaks validation of additionalItems #69071
Closed
openreply-dleinhaeuser opened this issue
Feb 20, 2019
· 1 comment
· Fixed by microsoft/vscode-json-languageservice#69
Closed
[json] $ref breaks validation of additionalItems #69071
openreply-dleinhaeuser opened this issue
Feb 20, 2019
· 1 comment
· Fixed by microsoft/vscode-json-languageservice#69
Labels
Milestone
Comments
aeschli
changed the title
$ref breaks validation of additionalItems
[json] $ref breaks validation of additionalItems
Feb 21, 2019
Any news about this bug? actually anything that is in additionalItems that is not "true" or a simple type ("number", "string", etc...) is ignored. Type "object" with its properties, or a reference is just ignored. At my side {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Container",
"type": "object",
"additionalProperties": false,
"properties": {
"Stream": {
"$ref": "#/definitions/Stream"
}
},
"definitions": {
"Stream": {
"type": [
"array"
],
"items": [
{
"$ref": "#/definitions/Input"
}
],
"additionalItems": {
"$ref": "#/definitions/Pipe"
}
},
"Input": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/Input1"
},
{
"$ref": "#/definitions/Input2"
}
]
},
"Input1": {
"type": "object",
"additionalProperties": false,
"properties": {
"Type": {
"type": "string",
"enum": [
"Input1"
]
},
"Prop1": {
"type": "integer",
"format": "int32"
},
"Name": {
"type": "string",
"minLength": 1
}
}
},
"Input2": {
"type": "object",
"additionalProperties": false,
"properties": {
"Type": {
"type": "string",
"enum": [
"Input2"
]
},
"Prop2": {
"type": "integer",
"format": "int32"
},
"Name": {
"type": "string",
"minLength": 1
}
}
},
"Pipe": {
"type": "object",
"oneOf": [
{
"$ref": "#/definitions/Pipe1"
},
{
"$ref": "#/definitions/Pipe2"
}
]
},
"Pipe1": {
"type": "object",
"additionalProperties": false,
"properties": {
"Type": {
"type": "string",
"enum": [
"Pipe1"
]
},
"NumberOfLegs": {
"type": "integer",
"format": "int32"
},
"Name": {
"type": "string",
"minLength": 1
}
}
},
"Pipe2": {
"type": "object",
"additionalProperties": false,
"properties": {
"Type": {
"type": "string",
"enum": [
"Pipe2"
]
},
"NumberOfWings": {
"type": "integer",
"format": "int32"
},
"Name": {
"type": "string",
"minLength": 1
}
}
}
}
} validated json that should not be accepted: {
"Stream": [
{
"Type": "Input1",
"Name": "qsdfgf",
"Prop1": 45
},
"not only these is no intellisense",
"but it also validates!",
{
"prop1": "anything",
"prop2": "is validated"
},
54
]
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Steps to Reproduce:
$ref
is used insideadditionalItems
Expected result:
Squiggly lines below the second item in the array.
Actual result:
JSON file passes validation
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: