You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In
DefaultCodegen
we have some methods that work with the currentopenAPI
instance, other that do not.We have methods that use
Map<String,Schema>
(corresponding toopenAPI.getComponents().getSchemas()
) => this corresponds toallDefinitions
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 realitypublic 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 adaptedpublic 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
andrequestBodies
.The text was updated successfully, but these errors were encountered: