OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.56k stars 6.52k forks source link

[BUG] Child Schemas are not able to be populated into model list #7408

Open identify3d-joe opened 4 years ago

identify3d-joe commented 4 years ago

Bug Report Checklist

Description

I am using bundled code from swagger cli. In my case, the bundler is putting $ref to Schemas that are a few levels deep into response and requestBodies (i.e. properties of objects that are properties of object...etc.). Currently, in the default generator, the models are gathered by this call:

''' java final Map<String, Schema> schemas = ModelUtils.getSchemas(this.openAPI); '''

which, in the javadocs, is stated the following:

'''java /**

In my local clone, I have added a function to "true up" the schemas above by looking for all schemas and then adding the new ones to the map. Later, everything seems to work correctly, especially when I have fixed the path walking issue in #7400. However, this seems like a separate issue, so I am filing it separately.

All of my work has been based off of v4.3.1. I can create a PR upon request, but I am not sure if my solution is the correct one for the maintainers.

georgiev-anton commented 1 year ago

I found a way to get around this

https://github.com/OpenAPITools/openapi-generator/issues/7400#issuecomment-1741631916