OpenAPITools / OpenAPITools/openapi-generator
[BUG] [JAVA] Generated classes no longer contain instantiated lists
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Some time ago, there was a change so that Java lists are instantiated instead of null:
private List<Foo> foos = new ArrayList<>();
instead of
private List<Foo> foos = null;
This was the change that provided instantiated lists: https://github.com/OpenAPITools/openapi-generator/pull/1683
It worked in version 4.0.0 and 4.1.0, but it no longer works in version 4.1.1 and 4.1.2.
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
Compare generated Java classes from versions 4.1.0 through 4.1.2, focusing on whether list fields are initialized or null. Read the change in pull request 1683 and trace the generator path responsible for Java field declarations. Done means the regression is reproduced, its cause is identified, and generated lists again use the intended initialization with coverage for the affected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100