openapi-generator-cli icon indicating copy to clipboard operation
openapi-generator-cli copied to clipboard

Generating client with multiple files as input

Open uc-asa opened this issue 3 years ago • 2 comments

Multiple file input and input with ref in YAML doesn't support.

uc-asa avatar Sep 26 '22 11:09 uc-asa

Hi @uc-asa , I found a solution as follows: 1/ Create openapitools.json with the following configuration

{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "5.3.0",
    "generators": {
      "publicApi": { // This name is arbitrary string 
        "generatorName": "typescript-angular",
        "glob": "./openapi_spec/publicApi.yaml",
        "output": "./src/app/openapi_codegen/publicApi",
      },
      "privateApi": { // This name is arbitrary string 
        "generatorName": "typescript-angular",
        "glob": "./openapi_spec/privateApi.yaml",
        "output": "./src/app/openapi_codegen/privateApi",
      },
     ... // add configurations for other spec files as expected
    }
  }
}

2/ Run the command: openapi-generator-cli generate --generator-key publicApi privateApi

minh-thai avatar Nov 29 '22 02:11 minh-thai

Turning off useDocker seems to work for us. Unfortunately this brings other problems with it.

bodograumann avatar Mar 30 '23 13:03 bodograumann