OpenAPITools / OpenAPITools/openapi-generator
[REQ] Add builder() to data classes for easier creation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
At the moment you have to create instance of object beforehand and then set parameters on it... Can you add Builder to classes (similar to what lombok has).
So instead of doing it like this:
Class1 test = new Class1();
test.setClass2(new Class2().id("test").something('hshj"));
you could use sometjing like this
Class1 test = Class1.builder()
.class2(Class2.builder().id("test").build())
.build();
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 names no files, tests, or generation entry points. Start by locating the Java data-model generation path and reviewing how generated classes are structured; done would mean the relevant generated data classes consistently expose a builder-based creation API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100