vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

String does not match the pattern of "^3\.1\.\d+(-.+)?$".yaml-schema: openapi.json

Open k98kurz opened this issue 11 months ago • 0 comments

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

  1. Create an openapi.yml file
  2. Type "openapi: '3.0.0'" followed by a new line
  3. Observe the error.

Environment

  • [ ] Windows
  • [ ] Mac
  • [x] Linux
  • [ ] other (please specify)

k98kurz avatar Nov 17 '24 09:11 k98kurz