swagger-api / swagger-api/swagger-codegen
Generated Pojo should have @JsonInclude.Include.NON_NULL jackson annotation at field level and not just at class level.
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The POJO class generated by codegen does not have the functionality to add @JsonInclude.Include.NON_NULL at a field level. THere is a provision to add it at class level or project level. It would be great if we can add a flag in yaml configuration to include the above Jackson annotation in the POJO created
Swagger-codegen version
2.3.1
Swagger declaration file content or url
Command line used for generation
Java and spring
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
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 by locating the Java and Spring POJO generation entry points, the YAML configuration handling, and the relevant generation tests. Reproduce generation with a YAML option and inspect the generated POJO fields; done means the requested field-level Jackson annotation is controlled by configuration and covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100