OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.69k stars 6.55k forks source link

[Java][Spring] Make generated API model classes Java Serializable #1619

Open r-alukhanov opened 5 years ago

r-alukhanov commented 5 years ago

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.

jmini commented 5 years ago

Can you propose a pull request for this?