OpenAPITools / OpenAPITools/openapi-generator
[REQ] [SPRING] Add support for importing custom lambdas
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.
I would like to be able to use a lambda for converting text from camelCase to SCREAMING_SNAKE_CASE using Spring codegen.
Describe the solution you'd like
A custom lambda directory defined using configuration.lambdaDirectory would be scanned for custom mustache lambdas, that would implement Mustache.Lambda interface. These would be registered with the rest of Spring lambdas, so they could be used from within custom mustache templates.
Describe alternatives you've considered
I considered adding this as a new lambda in Spring codegen, however there is a lot of combinations of case to case conversions, which can be implemented using different libraries, so a custom solution is probably better.
Additional context
https://github.com/OpenAPITools/openapi-generator/blob/master/docs/templating.md#mustache-lambdas
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
Start with the templating documentation section on Mustache lambdas and the Spring codegen entry points that register existing lambdas. Trace how configuration.lambdaDirectory could be discovered and custom Mustache.Lambda implementations registered; done means a custom lambda can be used from a Spring codegen template.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100