OpenAPITools / OpenAPITools/openapi-generator
[Java][Spring] Make generated API model classes Java Serializable
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
The Java classes of the model generated by OpenAPI are perfect candidates to be Java Serializable. Unfortunate I did not find a way to make the generated model classes implement Serializable interface.
Without serialization it is not possible to store model objects as part of the JEE/Web-Container Session. It also restricts the usage of these objects as part of Java Exceptions and inside other serializable classes.
On the other hand I do not see any disadvantages of being serializable in case of DTO objects.
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/Spring model-generation entry point and the templates that produce model classes, then check how generated output is tested. Done means generated API model classes implement Java Serializable without breaking existing generation tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100