-
Notifications
You must be signed in to change notification settings - Fork 524
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
Schema $ref with same name is not producing models properly #1089
Comments
@vinodchitrali In other to check the code, can you please send us a failing PR so we can add a test to parser and try this out? Thanks! |
@gracekarina , I dont have failing PR. |
Hi @vinodchitrali please bring the test case here please, so I can review. |
@vinodchitrali Thank your for your mention about the test case I added. I'll file a PR which add the test case so that it could be reviewed. |
@gracekarina I've added the test case #1097 . |
Any progress on this one ? Facing the same problem as well which basically forces a single-file-spec approach, which is quite problematic for large specs. |
My schema definition are spread across multiple files and they are cross reference(using $ref). In these files there is one schema with same name. I have 5 such instances
When i run code generator, Only 2 models are produced. Rest are ignored. Some of the $ref are pointing to wrong model.
I see some issue in the following code.
https://github.com/swagger-api/swagger-parser/blob/master/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/ExternalRefProcessor.java#L87
In above code, possiblyConflictingDefinitionName remains same through out the loop. If possiblyConflictingDefinitionName = "model" then the outcome of the loop is always tryName = "model_2".
I am hitting same issue.
So above code should be
Can some one help me to validate this code
The text was updated successfully, but these errors were encountered: