vscode-yaml
vscode-yaml copied to clipboard
Possible bug in allOf processing
Describe the bug
vscode linter shows an incorrect message of "Property x is not allowed" if the property is defined in an object referenced in an allOf statement
Expected Behavior
o3:
p1: www
p2: 2
p3: false
validator shouldn't show errors (Property p1 is not allowed, Property p2 is not allowed, Property p3 is not allowed)
for this schema:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"definitions": {
"o1": {
"type": "object",
"properties": {
"p1": {
"type": "string"
},
"p2": {
"type": "number"
}
},
"required": [
"p1",
"p2"
]
},
"o2": {
"type": "object",
"properties": {
"p3": {
"type": "boolean"
}
},
"required": [
"p3"
]
}
},
"properties": {
"o3": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/o1"
},
{
"$ref": "#/definitions/o2"
}
]
}
},
"required": [
"o3"
]
}
Current Behavior
The validator shows the manifest as incorrect.
Steps to Reproduce
- Define the schema an associate it to the manifest a.test.yaml
- fill the manifest with the above manifest example
- check the errors
Environment
- [ ] Windows
- [ ] Mac
- [X ] Linux
- [ ] other (please specify)