Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #83
Closed
Open
Issue created May 17, 2018 by Administrator@rootContributor

DefaultCodegen: code-cleanup, propagate the openAPI instance

Created by: jmini

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.

Assignee
Assign to
Time tracking