-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
DefaultGenerator: unusedSchemas contains too many schemas #50
Comments
Propose PR #74 |
I was trying to use openapi to generate a client for keycloak - and it doesn't work because requestBody of content type
the following works but the following does not.. |
…norepo chore(deps): update dependency jest to v26.5.2
Some model object are missing when the server is configured to consume both
application/json
andapplication/x-www-form-urlencoded
.With this example the model
SomeObject
is not generated:This is due to
org.openapitools.codegen.utils.ModelUtils.getUnusedSchemas(OpenAPI)
not working as expected.I am not sure if the dual
consumes
definition is correct or not (it is derived from a spec send by a used), but we could also imagine an other case with 2 path. In one JSON is expected as request body, in the other anapplication/x-www-form-urlencoded
request body. In this case, the schema is also used.In my opinion the logic to compute the unused schema should be to compute all the used schema and subtract them from a set containing all schemas.
The text was updated successfully, but these errors were encountered: