-
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 produced when shared schema references local schema #1961
Comments
AmateurECE
changed the title
Duplicated schemas produced when referenced locally and externally
Duplicated schemas produced when shared schema references local schema
Aug 15, 2023
AmateurECE
added a commit
to AmateurECE/swagger-parser
that referenced
this issue
Nov 9, 2023
AmateurECE
added a commit
to AmateurECE/swagger-parser
that referenced
this issue
Nov 9, 2023
AmateurECE
added a commit
to AmateurECE/swagger-parser
that referenced
this issue
Nov 9, 2023
Hi there! Has anyone from the team had a chance to review this pull request yet? Thanks very much for your consideration. |
AmateurECE
added a commit
to AmateurECE/redfish-codegen
that referenced
this issue
Aug 8, 2024
With the 2024.1 models, swagger-parser is now creating additional duplicated schemas in the graph, suffixed with "_1". This is the same behavior that was observed in swagger-api/swagger-parser#1961, only this time it's appearing even with my changes to v2.1.17. Since I'm committed at this point to a Rust rewrite, implement a hack to allow model generation to succeed.
AmateurECE
added a commit
to AmateurECE/redfish-codegen
that referenced
this issue
Aug 12, 2024
With the 2024.1 models, swagger-parser is now creating additional duplicated schemas in the graph, suffixed with "_1". This is the same behavior that was observed in swagger-api/swagger-parser#1961, only this time it's appearing even with my changes to v2.1.17. Since I'm committed at this point to a Rust rewrite, implement a hack to allow model generation to succeed.
AmateurECE
added a commit
to AmateurECE/redfish-codegen
that referenced
this issue
Aug 15, 2024
With the 2024.1 models, swagger-parser is now creating additional duplicated schemas in the graph, suffixed with "_1". This is the same behavior that was observed in swagger-api/swagger-parser#1961, only this time it's appearing even with my changes to v2.1.17. Since I'm committed at this point to a Rust rewrite, implement a hack to allow model generation to succeed.
AmateurECE
added a commit
to AmateurECE/redfish-codegen
that referenced
this issue
Aug 15, 2024
With the 2024.1 models, swagger-parser is now creating additional duplicated schemas in the graph, suffixed with "_1". This is the same behavior that was observed in swagger-api/swagger-parser#1961, only this time it's appearing even with my changes to v2.1.17. Since I'm committed at this point to a Rust rewrite, implement a hack to allow model generation to succeed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following schemas:
TestCase.yaml:
TestCase.v1.yaml:
While parsing TestCase.yaml,
swagger-parser
produces a duplicate schema,TestCase_Foo_1
. The path of logic that introduces the duplicate schema begins at ExternalRefProcessor.java:60, where the comparison fails becausenewSchema.properties.get("FooTypes").items.$ref
is"./TestCase.yaml#/components/schemas/TestCase_FooType"
, while inexistingModel
it's"#/components/schemas/TestCase_FooType"
. I'm hoping to either bring this issue to light so that the maintainers can implement a fix, or suggest a fix that I can implement and submit a pull request for. I'm open to either!This behavior is present at the HEAD of master (currently 2.0.17-SNAPSHOT, #08a76302e250), and as far back as 2.0.11. Unfortunately, I can't test with releases pre-2.0.11.
The text was updated successfully, but these errors were encountered: