Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DefaultCodegen: code-cleanup, propagate the openAPI instance #83

Open
jmini opened this issue May 17, 2018 · 1 comment
Open

DefaultCodegen: code-cleanup, propagate the openAPI instance #83

jmini opened this issue May 17, 2018 · 1 comment

Comments

@jmini
Copy link
Member

jmini commented May 17, 2018

In DefaultCodegen we have some methods that work with the current openAPI instance, other that do not.

We have methods that use Map<String,Schema> (corresponding to openAPI.getComponents().getSchemas()) => this corresponds to allDefinitions in a OAS2.

Now that Components in OAS3 is more than just the schemas, all methods should work with openAPI.


In particular:

The method public CodegenModel fromModel(String name, Schema schema) is really confusing. It is used a lot in the tests, but in reality public CodegenModel fromModel(String name, Schema schema, Map<String, Schema> allDefinitions) is used.

We should remove public CodegenModel fromModel(String name, Schema schema) or if we keep it, give a more explicit name.

And all Unit-Tests should use: public CodegenModel fromModel(String name, Schema schema, Map<String, Schema> allDefinitions) (or the adapted public CodegenModel fromModel(String name, Schema schema, OpenAPI openAPI) after the change described here)


We will need to refer to Components more and more. For example if we want to solve #8 we need to look at the referenced responses and requestBodies.

@jmini
Copy link
Member Author

jmini commented May 18, 2018

This proposition is disruptive at Java-API level. Please follow discussion in #90

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant