OpenAPITools / OpenAPITools/openapi-generator

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

Open
#19,587 5 comments 11 reactions 1 assignee View on GitHub

@kay-schecker is already working on this.

Since May 23, 2023.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

🐛 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.