swagger-api / swagger-api/swagger-parser
[OAS3] - Getting different Schemas when converting or not
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
Hi,
I'm planning to use SwaggerConverter to convert Swagger v2 to OpenAPI v3 specifications when input file was using old format. And no conversion when file is already in OAS 3 format. However, I'm running into an issue by doing this.
If input file is in OAS3 format, the OpenAPI object contains ObjectSchema objects inside (as expected) but when using SwaggerConverter I have instances of Schema instead. My code relies on the type of Schema to do proper logic and having different types of objects is breaking the logic of the code. I was expecting to end up with the same type of objects whether a conversion was needed or not. Is this a valid assumption?
I will use an external tool to do the conversion between formats for now as a way to guarantee same type of objects. Let me know if you need more info to reproduce this.
Thanks,
Gaston
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 at the SwaggerConverter entry point and reproduce the difference between parsing an OAS3 input directly and converting a Swagger v2 input. Compare the resulting schema object types and determine whether both paths should expose the same types; done means the behavior is consistent or the expected distinction is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100