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

[BUG] - How to generate code for specific tag/path? specifying `--globalProperty=apis=user` is not working.

Open dinbtechit opened this issue 2 years ago • 0 comments

🐛 Bug Report:

Describe the bug

How to generate code for specific endpoint? specifying --globalProperty=apis=user is not working.

Steps to Reproduce

  1. Create openapitools.json with globalProperty such that it generates code only for user endpoints
{
  "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,

  "generator-cli": {
    "version": "6.6.0",
    "generators": {
      "petstore": {
        "generatorName": "typescript-nestjs",
        "inputSpec": "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml",
        "output": "src/petstore/codegen",
        "skipValidateSpec": true,
        "globalProperty": {. <---<<<
          "apis": "user"
        },
        "additionalProperties": {
          "modelPropertyNaming": "camelCase",
          "useSingleRequestParameter": true
        }
      }
    }
  }
}

  1. Generate code
 openapi-generator-cli generate --generator-key petstore

output: (you can see the --global-property="apis=user" is created. )

 java -jar "..../.nvm/versions/node/v16.17.0/lib/node_modules/@openapitools/openapi-generator-cli/versions/6.6.0.jar" generate --input-spec="https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" --generator-name="typescript-nestjs" --output="src/petstore/codegen" --skip-validate-spec --global-property="apis=user" --additional-properties="modelPropertyNaming=camelCase,useSingleRequestParameter=true" exited with code 
  1. no code is generated and no errors

Expected behavior

Update documentation on how to generate code for specific endpoints. Current globalProperties -> apis

Operation System (please complete the following information):

  • OS: MacOS Ventura
  • Version: 13.3.1

Package System (please complete the following information):

  • Version: npm: 2.6.0 | jar: 6.6.0

dinbtechit avatar May 23 '23 22:05 dinbtechit