ferdikoomen / openapi-typescript-codegen

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

Ability to provide custom path to the core directory #882

Open mbraint opened 2 years ago

mbraint commented 2 years ago

Describe the solution you'd like In my case, I want to extract the core once and use it for the newly generated artifacts with --exportCore false are based on different open API specifications

It requires the new cli option e.g. --corePath <value> it may be relative path or npm package variants:

How I want to use that:

  1. extract only core in some app directory e.g. app/shared/httpClient or generate and publish a package with core only functionality
  2. generate new artifacts for userManagement into app/api/userManagement with --corePath ../../shared/httpClient
  3. repeat step 2 for others APIs
anthonyLock commented 1 year ago

hello,

I have created a PR for this feature as I needed it. Please take a look and see if it helps. https://github.com/ferdikoomen/openapi-typescript-codegen/pull/1399