{
"yaml.schemas": {
"test.schema.json": "test.yaml"
}
}
{
"$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
}
}
}
tag:
- category: A
name: T1
No Error
I get the following error on name.
Matches multiple schemas when only one must validate.
This is actually because the current version released on the marketplace doesn't support JSON Schema 6 or 7 (I believe const was from JSON Schema 6) . When testing it out on the newest version of the YAML language server it doesn't throw any errors.
The version supporting JSON Schema 7 should be released within a couple weeks.
Any updates on releases with support for Schema 7
I was initially confused because the ReadMe at the root level lists support for Schema 7 since May 27, but then realized that releases might not be on the latest version.
In either case, thanks for the awesome tool, and I appreciate any support time you have! :)
@KyleMit It should all be working with our latest release (0.5.x). I've just double checked with the above example and everything is working. If you come across any other json schema 7 issues please file a bug report!
Ok, great, thanks for the added clarity! I was noticing some issues so I'll document test cases for them in another thread
Most helpful comment
This is actually because the current version released on the marketplace doesn't support JSON Schema 6 or 7 (I believe const was from JSON Schema 6) . When testing it out on the newest version of the YAML language server it doesn't throw any errors.
The version supporting JSON Schema 7 should be released within a couple weeks.