Skip to content

[BUG] Custom generator not being recognized by CLI #439

@kamilgregorczyk

Description

@kamilgregorczyk

Custom generator is not recognized during generation when using openapitools.json

I installed CLI via:

npm install -g @openapitools/[email protected]

then I generated successfully API via:

openapi-generator-cli generate --custom-generator=some-custom-generator/build/libs/some-custom-generator-1.0-SNAPSHOT.jar -g some-custom-generator -i some-service/docs/fe_doc.yaml -o some-client

but when I configured my openapitools.json like this:

{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "5.2.0",
    "generators": {
      "fe_doc": {
        "generatorName": "some-custom-generator",
        "glob": "some-service/docs/fe_doc.yaml",
        "output": "some-client",
        "additionalProperties": {
          "authType": "basic"
        }
      }
    }
  }
}

and running:

openapi-generator-cli generate --custom-generator=some-custom-generator/build/libs/some-custom-generator-1.0-SNAPSHOT.jar

I got [error] Check the spelling of the generator's name and try again.

I also tried putting some-custom-generator/build/libs/some-custom-generator-1.0-SNAPSHOT.jar as generatorName instead of some-custom-generator but it didn't work

doing:

openapi-generator-cli list --custom-generator=some-custom-generator/build/libs/some-custom-generator-1.0-SNAPSHOT.jar

lists my custom generator, at the bottom

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions