Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using extension with existing openapi json file #308

Open
tolga-ercan opened this issue Jan 3, 2025 · 6 comments
Open

Using extension with existing openapi json file #308

tolga-ercan opened this issue Jan 3, 2025 · 6 comments

Comments

@tolga-ercan
Copy link

I can't find anywhere that I can open an existing openapi spec json file using this extension. The only options I can find is to create a new file?

@ak1394
Copy link
Collaborator

ak1394 commented Jan 3, 2025

Click on the existing OpenAPI spec in the VS Code Explorer, ide will open editor tab showing it's contents. Then click on the API icon with the OpenAPI file visible, and you'll see relevant paths etc. in there.

@anthony-42crunch
Copy link
Contributor

anthony-42crunch commented Jan 4, 2025

@tolga-ercan
here's a short demo that addresses your question: link
Feel free to also post any questions in the developer forum

@hskrasek
Copy link

hskrasek commented Feb 4, 2025

Tagging onto this, I just installed the extension, opened an existing spec file and the OpenAPI tab doesn't recognize it at all. Unsure if this is an incompatibility with v3.1.0 or not.

@anthony-42crunch
Copy link
Contributor

@hskrasek When you say it doesn't recognize the file, can you elaborate?

As long as the extension was successfully installed, you should see the OpenAPI editor icon on the VSCode activity bar.
And if the opened file is a valid Swagger or OpenAPI file, clicking on the OpenAPI editor icon should open an outline of your OpenAPI contract.

There's a short video here. Let me know if you're seeing something different (and if so what).

@hskrasek
Copy link

hskrasek commented Feb 7, 2025

@anthony-42crunch Here's a screenshot of what I mean. I have an OpenAPI file open, but the OpenAPI tab/section in VS Code doesn't recognize it.

Image

But if I click on New OpenAPI File, it immediately recognizes the new but unsaved file correctly

Image

@anthony-42crunch
Copy link
Contributor

anthony-42crunch commented Feb 7, 2025

Yes that is related to support for OAS 3.1, which is in the works but not yet available.
As a temporary workaround, changing the openapi version number in the file to 3.0.x at least enables navigation for the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants