redhat-developer / redhat-developer/vscode-yaml
String does not match the pattern of "^3\.1\.\d+(-.+)?$".yaml-schema: openapi.json
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
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
- Linux
- other (please specify)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Reproduce the validation error in VS Code with an OpenAPI 3.0.0 YAML file, then trace schema resolution from the YAML Schema Store catalog and the linked OpenAPI schema URL. Done means valid 3.0.0 documents no longer receive the 3.1-only pattern error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100