swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.73k stars 6.02k forks source link

[swagger Model ] How to categorise models #6926

Open sashank opened 6 years ago

sashank commented 6 years ago

This is more of a question.

I have around 20 model definitions in swagger.yaml and when i generate code its quite messy with all the models being in same directory. Is there a way to categorize them ?

Say i have models definitions for cats, chairs, dogs, tables, books, pens . How do i generate code that categorises into sub packages like below

models.animals
  cats, dogs
models.furniture
 tables,chairs
models.stationary
 books, pens 
wing328 commented 6 years ago

What about grouping different model into separate files and then generate models only (https://github.com/swagger-api/swagger-codegen#selective-generation)?

sakp1711 commented 5 years ago

Any enhancement which supports this as of now?

garyee commented 4 years ago

We do have more then 100. It would be great to have something like the 'tags' keyword for the models.

CasperWSchmidt commented 4 years ago

This goes for C# as well.

JamalAbsalimov commented 1 year ago

It would be nice to group models by type like this. Example: Response -> TransactionResponse -> StatusResponse Request -> TransactionRequest -> StatusRequest