openapi-generator
openapi-generator copied to clipboard
[REQ] Model generation only
Is your feature request related to a problem? Please describe.
Nope.
Describe the solution you'd like
I wonder if it is doable to implement some kind of option which tells the generator to only generate the model files rather than having all the other files being created.
Something like:
npx @openapitools/openapi-generator-cli generate -i openapi.json -g typescript-angular -o generated-models/ --models-only
[main] INFO o.o.codegen.TemplateManager - writing file /path/of/generated-models/./whateverGet200Response.ts
[...]
Describe alternatives you've considered
None.
Additional context
None.
What generator we are talking about here? This is possible to be done already. Depending on generator you can specify:
withSeparateModelsAndApi=true,modelPackage=model,apiPackage=api
as properties. Ignore API folders or many different things. I believe that only generator that makes it "tricky" is golang - golang one has single package for both model and API.
Also, I just found you can use --global-property models,apis
if you only want models and apis to be created for example
@alec-petersen Actually this is better suggestion as it would be supported in every generator!
https://github.com/OpenAPITools/openapi-generator/issues/12754#issuecomment-1282285724 Thanks !
Also, I just found you can use
--global-property models,apis
if you only want models and apis to be created for example
Thanks ! this worked for me
Closing here for now. Haven't actually tested this but since we got feedback that it should work, this request is obsolete.