[gradle]: allow setting custom engines other than handlebars#10416
[gradle]: allow setting custom engines other than handlebars#10416wing328 merged 1 commit intoOpenAPITools:masterfrom
Conversation
…use default javacodegen as base current gradle plugin version is from mavenLocal, waiting for pr OpenAPITools/openapi-generator#10416 to be merged.
Thanks for the PR. What other values are allowed? Shall we validate the input to only allow |
When working with a custom engine (https://openapi-generator.tech/docs/templating/#custom-engines) - example https://github.com/twitch4j/nitro-codegen/blob/master/template-engine/src/main/java/com/github/twitch4j/codegen/engine/PebbleEngineAdapter.java#L26 - it's important that users can provide the custom identifier value ( If users provide a invalid value than the openapi-generator will return this kind of error: Therefore i don't think we need this kind of validation in the gradle plugin, as we already get good error messages from the generator. |
|
@PhilippHeuer thanks for the PR and the explanation. Makes sense to me. |
The openapi-gradle generator plugin has a strict check on the
engineparam to only set the parameter ifhandlebarsis set as value. Otherwise the parameter is ignored. This is currently blocking anyone from specifiying custom template engines (https://openapi-generator.tech/docs/templating/#custom-engines) when using the official gradle plugin.This change will set the
engineparam to the user-provided value, even if it's nothandlebars.The engine param was initially added in: #5686
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x