swagger-api / swagger-api/swagger-parser

[OAS3] - Getting different Schemas when converting or not

Open
#528 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.