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

feat(custom generators): added '--custom-generator' parameter fixes #237 #335

Merged
merged 14 commits into from
May 19, 2021
Merged

feat(custom generators): added '--custom-generator' parameter fixes #237 #335

merged 14 commits into from
May 19, 2021

Conversation

mcaden
Copy link
Contributor

@mcaden mcaden commented Apr 27, 2021

usage:

--custom-generator=path/to/my/generator.jar

It handles the difference in the classpath delimiter on windows and other systems.

Should fix #237

Tested in Windows and Ubuntu.

@SardarNL
Copy link

Does it work on your machine? I tried:

npm run build
npm run cli -- --custom-generator=/path/to/extensions.jar list

I get error: unknown option '--custom-generator=...'

@mcaden
Copy link
Contributor Author

mcaden commented Apr 29, 2021

This works:

npm run cli -- list --custom-generator=/path/to/extensions.jar

The difference is simply that list is before the --custom-generator

I also tested using npm link in the dist/apps/generator-cli directory and used it on an actual project with a real custom generator. Worked beautifully.

yarn openapi-generator-cli generate -i swagger.json -g my-generator -o out --additional-properties=supportsES6=true,withInterfaces=true --custom-generator=path/to/my-generator.jar

@mcaden mcaden changed the title feat(custom generators): added '-custom-generator' parameter fixes #237 feat(custom generators): added '--custom-generator' parameter fixes #237 Apr 29, 2021
@SardarNL
Copy link

Indeed, it works!

I managed to do the same by simply cloning this repo and building our own cli wrapper. But the official solution is way better.

@mcaden
Copy link
Contributor Author

mcaden commented May 17, 2021

@kay-schecker Please let me know if there's anything else I need to do in order to make this eligible for merge.

@kay-schecker kay-schecker marked this pull request as draft May 18, 2021 10:44
@kay-schecker kay-schecker self-requested a review May 18, 2021 10:44
@kay-schecker kay-schecker self-assigned this May 18, 2021
@kay-schecker
Copy link
Contributor

kay-schecker commented May 18, 2021

Hi, please fix the linting errors: https://github.com/OpenAPITools/openapi-generator-cli/pull/335/files

@mcaden mcaden marked this pull request as ready for review May 18, 2021 16:00
@mcaden
Copy link
Contributor Author

mcaden commented May 18, 2021

@kay-schecker Ah, fixed. I'm too used to that being a part of the build/commit process and didn't run lint separately.

@kay-schecker kay-schecker merged commit 0645163 into OpenAPITools:master May 19, 2021
@github-actions
Copy link

🎉 This PR is included in version 2.3.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[missing feature] custom generators on classpath are not visible
3 participants