ferdikoomen / openapi-typescript-codegen

NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
MIT License
2.97k stars 525 forks source link

Select/Filter Tags to generate specific Services only #2017

Open kosiakMD opened 9 months ago

kosiakMD commented 9 months ago

Big thanks for the nice solution! Is there is possible way to filter/select tags to create only specific Services per generation? I use separations on 2 levels: 1) Swagger: admin / clients 2) Tag level for different clients: manager/public/etc - and here I used openapi generator (that one Java based) to have separation and selection, but would like to use your's solution instead

mrlubos commented 8 months ago

@kosiakMD you can do this with @nicolas-chaulet/openapi-typescript-codegen by supplying a regular expression to the exportServices parameter. For example,

openapi --input openapi.json --output src/client --exportServices ^Foo

This will generate only services whose names start with "Foo"