Data
VSCode Setting
{
"yaml.schemas": {
"test.schema.json": "test.yaml"
}
}
Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/test.schema.json",
"title": "Test",
"description": "Bug Test",
"type": "object",
"properties": {
"tag": {
"$ref": "#/definitions/tags"
}
},
"definitions": {
"tag": {
"type": "object",
"properties": {
"category": {
"type": "string",
"enum": ["A", "B"]
},
"name": {
"oneOf": [
{ "title": "T1", "const": "T1" },
{ "title": "T2", "const": "T2" },
{ "title": "T3", "const": "T3" }
]
}
},
"additionalProperties": false,
"required": ["category", "name"]
},
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/tag"
},
"uniqueItems": true
}
}
}
YAML
tag:
- category: A
name: T1
Expected
No Error
Result
I get the following error on name.
Matches multiple schemas when only one must validate.
Data
VSCode Setting
{ "yaml.schemas": { "test.schema.json": "test.yaml" } }Schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://example.com/test.schema.json", "title": "Test", "description": "Bug Test", "type": "object", "properties": { "tag": { "$ref": "#/definitions/tags" } }, "definitions": { "tag": { "type": "object", "properties": { "category": { "type": "string", "enum": ["A", "B"] }, "name": { "oneOf": [ { "title": "T1", "const": "T1" }, { "title": "T2", "const": "T2" }, { "title": "T3", "const": "T3" } ] } }, "additionalProperties": false, "required": ["category", "name"] }, "tags": { "type": "array", "items": { "$ref": "#/definitions/tag" }, "uniqueItems": true } } }YAML
Expected
No Error
Result
I get the following error on
name.