Redocly / redocly-vs-code

Redocly VS Code extension
35 stars 6 forks source link

Highlighting error on OpenApi Version #56

Closed speedyT0RT0ISE closed 10 months ago

speedyT0RT0ISE commented 10 months ago

What happened? Error showing up with OpenAPI version openapi: 3.0.1

String does not match the pattern of "^3\.1\.\d+(-.+)?$".yaml-schema: openapi.json What should have happened instead? Should accept the version of 3.0.1

Minimal reproducible OpenAPI snippet openapi: 3.0.1

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

Screenshots

If applicable, add screenshots to help explain your problem.

image

Additional context Hi! Sorry aware this probably isnt a bug, but have trawled through docs and cant find where to set the OpenAPI version - really sorry if this is an obvious configuration error/ fix Add any other information about the problem here, like: the extension version number; OpenAPI version you're using in your definition; your operating system.

jeremyfiel commented 10 months ago

I believe this is an error with VS Code and your config. this is not related to Redocly.

If you have these or some other similar vs code settings, this is your problem. The schema for 3.1.0 is colliding with the 3.0.x schema.

 "yaml.schemas": {
    "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.yaml": [
      "/*openapi.yml",
      "/*openapi.yaml"
    ],
    "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.yaml": [
      "/*openapi.yml",
      "/*openapi.yaml"
    ]
}

the extension is named in the error output

image

Here's a different example where it shows Redocly OpenAPI is recognizing an error

image

speedyT0RT0ISE commented 10 months ago

Hi yes fixed with a VS code update - Sorry!