-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[cli] new 'author template' command #6441
[cli] new 'author template' command #6441
Conversation
This new command allows users to extract templates for authoring (customization) without the complexity of finding and downloading a specific directory for their versioned artifact. Example usage: ``` openapi-generator author template -g java --library webclient ``` This will write all templates with library-specific templates to the './out' directory relative to the current directory. CLI will refer the user to https://openapi-generator.tech/docs/templating after generation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
Thanks for the work on this. I'm sure users will find it useful to begin the template customization.
I tested with an invalid library name (e.g. webcli) but got the same (correct) output. What about validating the library name and output a proper error message if it's invalid? |
@wing328 we don't really have a way to check library names statically, especially since users can have a library on classpath by some wrapper, for instance if running via a fatjar depending on the CLI project. It might be confusing if we write most files but throw an exception, and I agree we should let them user know. How about a check at the end which evaluates if out/libraries/name exists and log a warning if it does not? The user can check spelling and rerun, this should overwrite existing files and directories. |
I'll go ahead and merge this. We can make any necessary improvements in a follow up PR. |
* master: [PS] Refactor the http signing auth with ecdsa support (OpenAPITools#6397) [Rust Server] Hyper 0.13 + Async/Await support (OpenAPITools#6244) [Rust] set supportAsync to true as the default (OpenAPITools#6480) [php-symfony] Set required PHP version ^7.1.3 (OpenAPITools#6181) update doc [csharp] Rename netstandard to netstandard1.3 (OpenAPITools#6460) feat: support deprecated parameters for typescript-axios generator (OpenAPITools#6475) [REQ][typescript-axios] useSingleRequestParameter should mark parameter optional if all properties are optional (OpenAPITools#6477) better struct alias in rust (OpenAPITools#6470) Migrate Go server samples to OAS 3 only (OpenAPITools#6471) [Rust][reqwest] add async support (OpenAPITools#6464) [codegen][python-experimental] Composed schema with additionalProperties (OpenAPITools#6290) [Java] Decommission Retrofit 1.x support (OpenAPITools#6447) remove scala oas3 samples (OpenAPITools#6446) [Java][jersey2] Fix RuntimeException when HTTP signature parameters are not configured (OpenAPITools#6457) [Java][jersey2] Improve http signature code comments (OpenAPITools#6463) [typescript-angular] drop support of angular below 6.0.0 (OpenAPITools#6360) [cli] new 'author template' command (OpenAPITools#6441) python-experimental updates ancestor + adds descendant discriminator tests (OpenAPITools#6417)
This new command allows users to extract templates for authoring (customization) without the complexity of finding and downloading a specific directory for their versioned artifact.
Example usage:
This will write all templates with library-specific templates to the './out' directory relative to the current directory. The user can specify an alternative directory as well. See the doc changes in this PR for more details.
CLI will refer the user to https://openapi-generator.tech/docs/templating after generation.
This PR is supplemental to the template quality PR #6357
This PR provides the start of authoring commands detailed in #1811
cc @OpenAPITools/generator-core-team
PR checklist
./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc).master
,4.3.x
,5.0.x
. Default:master
.