We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JAX-RS spec serializableModel config option does not generate imports for java.io.Serializable, causing compile errors on implements Serializable.
serializableModel
java.io.Serializable
implements Serializable
2.2.3, master
2.2.3
master
-DserializableModel=true
jaxrs-spec-petstore-server.sh
bin/jaxrs-spec-petstore-server.sh
package io.swagger.model; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; import io.swagger.annotations.*; import java.util.Objects; public class Pet implements Serializable { // ... }
Add the following to JavaJaxRS/spec/model.mustache:
JavaJaxRS/spec/model.mustache:
{{#serializableModel}} import java.io.Serializable; {{/serializableModel}}
This matches https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache#L13,L14,L15.
The text was updated successfully, but these errors were encountered:
PR: #6651
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Description
JAX-RS spec
serializableModel
config option does not generate imports forjava.io.Serializable
, causing compile errors onimplements Serializable
.Swagger-codegen version
2.2.3
,master
Steps to reproduce
-DserializableModel=true
tojaxrs-spec-petstore-server.sh
bin/jaxrs-spec-petstore-server.sh
implements Serializable
but no import forjava.io.Serializable
:Suggest a fix/enhancement
Add the following to
JavaJaxRS/spec/model.mustache:
This matches https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache#L13,L14,L15.
The text was updated successfully, but these errors were encountered: