OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.7k stars 6.55k forks source link

[REQ] Model destination folder #16744

Open tonireloaded opened 1 year ago

tonireloaded commented 1 year ago

Hi,

I tried to generate models on different folder with: "openapi-generator-cli generate -i src/api/pokeapi.yaml -g typescript-axios -o src/api --model-package models" or "openapi-generator-cli generate -i src/api/pokeapi.yaml -g typescript-axios -o src/api --additional-properties='modelPackage=models'"

I want that models would be created on folder src/api/models, but this file structure was created: image

Is this possible with any command parameter ?

leomcpugo commented 1 year ago

You need to setup the modelPackage and apiPackage along with the withSeparateModelsAndApi:true.
https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/typescript-axios.md