-
Notifications
You must be signed in to change notification settings - Fork 531
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
Duplicated schemas in parsed result #1081
Comments
@ackintosh can you add a failing test case. |
@r-sreesaran Thanks for your reply. I've filed the PR to add a failing test case. |
@ackintosh This may be valid as "Problem Details" is referenced from external open api document. It needs to be duplicated and added in the object. Consider a case where there are two schema having same name but of different type. Then in that case if we remove duplicate, then one schema will be lost. Here the Problems Details are present in both documents and have different definitions.
issue-1108-.yaml
@gracekarina @ymohdriz please do share your comments on this issue. |
Hi @r-sreesaran thanks for the reply, the case @ackintosh presents it's the same schema, so it should not be duplicating it. The case you present above it's ok for "duplicating" because there are different schemas. Sorry it's taking long for me to check this, I hope to have a fix for this week. |
@r-sreesaran Issue here is a new schema (ProblemDetails_2) is introduced in the components which is incorrect. We need to fix it |
@gracekarina Few clarifications about the duplication part from the example i have mentioned. As per Open API specification no two schema definitions can have the same name. Since these references are added from the same file this does qualify them to be treated as schemas from same document and in such case the open api document becomes invalid as there two schemas with name name. As of now we are not handling the references like wise. |
We've seen this issue as well using version 2.0.12. These two swagger files can be used to reproduce it if needed and will produce two models for flowDirection. spec1.yaml
spec2.yaml
|
I'm cross-posting my comment from an issue in openapi-generator as the issue is related to swagger-parser. Original link: OpenAPITools/openapi-generator#2701 (comment).
|
The Issue #1292 resolves this issue. The current master branch works. |
yes that is true!, we solve the duplication issue, thanks for pointing this here! |
I tested the two examples from @ackintosh and @jphorx and they work. Please close the issue. |
Related issue: OpenAPITools/openapi-generator#2701
Specs that reproduces the issue
Test codes which shows the issue
The
result
has a duplicated schemaProblemDetails_2
.The text was updated successfully, but these errors were encountered: