Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kamilgregorczyk opened this issue Aug 8, 2021 · 4 comments · Fixed by #620
Closed

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

kamilgregorczyk opened this issue Aug 8, 2021 · 4 comments · Fixed by #620
Assignees
Labels
bug Something isn't working released

Comments

@kamilgregorczyk
Copy link

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

@kamilgregorczyk kamilgregorczyk added the bug Something isn't working label Aug 8, 2021
@dapperdandev
Copy link

Any updates on this?

I wonder if we could produce a new schema that would accept a customGenerator property?

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

@millotp
Copy link
Contributor

millotp commented Feb 2, 2022

Can we get an update on this ? I'm experiencing the same issue.

@kay-schecker
Copy link
Contributor

Thanks for your feature request. 👍 I'll have a look during the next week.

@github-actions
Copy link

🎉 This issue has been resolved in version 2.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants