OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Spring] Configure different collection types.
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.
Spring have support of Vavr and we make use of it in our project. Recently we want to change our model to generate base Spring API to delegate the generation to openapi-generator.
If I try to use the mappings declared in the Spring generator documentation:
It almost work, problem is that in the mustache templates for api or model, the java.util.List and java.util.Map are hardcoded. That makes this feature impossible to use with Vavr as the io.vavr.collection.List import collides with the Java one.
Describe the solution you'd like
I would like to be able to configure the collection mappings and imports with vavr and generate a valid code.
Describe alternatives you've considered
Why are hardcoded these imports while in the other hand we should have the flexibility to change the types? I have tested removing the hardcoded imports and it does not seems to be needed. I suggest to use FQN for the calls to the collections whenever it is needed for the generated code.
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
Start with the Spring generator's mustache templates for APIs and models, then review the Spring generator documentation for import-mapping and instantiation-types. Done means collection types and imports can be configured for Vavr without collisions and the generated code is valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend-api-design, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100