OpenAPITools / OpenAPITools/openapi-generator

[REQ] [SPRING] Add support for importing custom lambdas

Open
#13,050 0 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.