vscode-yaml
vscode-yaml copied to clipboard
String does not match the pattern of "^3\.1\.\d+(-.+)?$".yaml-schema: openapi.json
Describe the bug
Files that start with openapi: '3.0.0' have a validation error. The file turns red as a result in all the UI, and the very first character of the file is underlined in red.
Expected Behavior
3.0.0 is a valid schema version number and should not cause an error.
In the settings, it has https://www.schemastore.org/api/json/catalog.json as the Yaml > Schema Store: Url value. Going there reveals that 3.0.0 is a supported schema, so this error is nonsense and makes the extension unusable if you want to write 3.0.0 openapi specs.
Current Behavior
Files that start with openapi: '3.0.0' have the following validation error:
String does not match the pattern of "^3\.1\.\d+(-.+)?$".yaml-schema: openapi.json
Clicking the link labeled "Source" results in this url: https://spec.openapis.org/oas/3.1/schema/2022-10-07
This is a false positive because, as I explained above, 3.0.0 is a valid OpenAPI spec version, and it is explicitly marked as such in the schema store.
Steps to Reproduce
- Create an openapi.yml file
- Type "openapi: '3.0.0'" followed by a new line
- Observe the error.
Environment
- [ ] Windows
- [ ] Mac
- [x] Linux
- [ ] other (please specify)