swagger-codegen-generators icon indicating copy to clipboard operation
swagger-codegen-generators copied to clipboard

Support for generating qualified model package/namespace

Open frode-carlsen opened this issue 4 years ago • 0 comments

The generator will currently place all generated model files in the same folder. This doesn't work well with larger models that may support different versions of the same API (requiring all model files to have unique names). The translation of schema names to model names also does a significant amount of character substitution, changing case etc. of the schema names, which further separates the generated code from the assigned schema name.

For example the following

 /my/path:
    post:
      ....
      requestBody:
        ...
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/some.namespace.Model'

will generate a SomeNamespaceModel class file in the io.swagger.model namespace instead of a Model class in some.namespace

Because there's a significant amount of conversion of model names by legacy (transliterating _. etc to title case. I propose to add a new flag to support generating fully-qualified names: useFqn

frode-carlsen avatar Dec 28 '21 08:12 frode-carlsen