swagger-api / swagger-api/swagger-parser
How do i check if a swagger/openapi file is v2 or v3?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Is there a utility method that takes the swagger/openapi content as input and returns the version of it?
I read the spec and know how to differentiate them but I am missing a method that returns the version so that I can decide if I want to feed the content into the V2 or the V3 parser.
I could write it myself but I think it makes sense to have such a method within the parser library - and it might be there already.
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
Start by checking the parser library's existing version-detection utilities and the V2 and V3 parser entry points. Compare the desired behavior with the Swagger/OpenAPI version fields; done means the utility identifies the input version so callers can select the corresponding parser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100