Description
Describe the bug
Expected Behavior
The YAML Language Server respects the $schema
property and checks against the meta-schema defined by it.
Current Behavior
The YAML Language Server ignores the $schema
property and instead checks against the JSON Schema Draft 7 meta-schema.
Steps to Reproduce
- Open VSCode
- Create a new file called
openapi.yml
- Switch the schema to version 3.0 (based on the added feature for Support versions from schemastore #639)
- Type anything
- Observe the error:
Schema 'schema.json' is not valid:
/definitions/Schema/properties/multipleOf/exclusiveMinimum : must be number
The Open API v3.0 schema uses the $schema
property like so:
"$schema": "http://json-schema.org/draft-04/schema#",
In Draft 4, exclusiveMinimum
MUST be a boolean.
However, in the latest draft (currently 2020-12), exclusiveMinimum
MUST be a number. It appears this is the meta-schema the language server is checking against, despite the schema specifically specifying Draft 4.
EDIT: It appears to be checking against Draft 7, which does also say exclusiveMinimum
MUST be a number.
EDIT 2: Ok so Draft 4 is REALLY old and is no longer in ajv
(the tool used to validate the schema). Not sure if this needs to be actioned, or if one would just need to wait for additional tooling (like Swagger) to finally support v3.1.
Environment
- Windows
- Mac
- Linux
- other (please specify)