OpenAPITools / OpenAPITools/openapi-generator
[REQ] Another template language like JSP/Thymeleaf
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
We needed to tweak the python geneation in order to disable validation and add some other functions to it. Adding ifs to it and other conditionals and debugging was painful.
Describe the solution you'd like
I'd like it if there was another possibility for generating the templates. I.e JSP.
The current mustache template language makes it super hard to really customize the generation of the apis. Its *logic-less and therefore simple ifs are not supported and other constructs. You need to result to exotic constructs cluttering up the code reasing. Our journey so far has been very painful for customizing the templates for python. Resulting in extra scripts that need to be run after the generation in order to fully generate things.
Personally i'd like it to have the least amount of friction when adjusting templates, and i understand mustache, if you really want to be secure of the inputs/outputs with limited logic (think of shops where end users can customize the layouts and you want to prevent running of untrusted code) but with api generation i want as much power as possible when adapting the templates.
Describe alternatives you've considered
- Spending hours on mustache templates
- Running scripts after the fact to patch the things we can't cover in mustache
- Making our on generator in javascript
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name files or tests. Start by tracing the existing Mustache template handling used by the Python generator, then compare the requested JSP/Thymeleaf-style conditionals and customization needs. Done would require a decided template-language integration that supports the requested generator customizations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript, python
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100