From 1bdb1047383879d845a9c27890c9476ffb2fcdfd Mon Sep 17 00:00:00 2001 From: Graham Johnson Date: Tue, 10 Oct 2017 08:45:47 -0600 Subject: [PATCH] Add Serializable import to JaxRS-spec models if serializableModel is set (#6651) --- bin/jaxrs-spec-petstore-server-interface.sh | 1 + bin/jaxrs-spec-petstore-server.sh | 3 ++- .../main/resources/JavaJaxRS/spec/model.mustache | 3 +++ .../gen/java/io/swagger/api/RestApplication.java | 9 +++++++++ .../swagger/model/AdditionalPropertiesClass.java | 3 ++- .../src/gen/java/io/swagger/model/Animal.java | 3 ++- .../gen/java/io/swagger/model/AnimalFarm.java | 3 ++- .../swagger/model/ArrayOfArrayOfNumberOnly.java | 3 ++- .../java/io/swagger/model/ArrayOfNumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/ArrayTest.java | 3 ++- .../java/io/swagger/model/Capitalization.java | 3 ++- .../src/gen/java/io/swagger/model/Cat.java | 3 ++- .../src/gen/java/io/swagger/model/Category.java | 3 ++- .../gen/java/io/swagger/model/ClassModel.java | 3 ++- .../src/gen/java/io/swagger/model/Client.java | 3 ++- .../src/gen/java/io/swagger/model/Dog.java | 3 ++- .../gen/java/io/swagger/model/EnumArrays.java | 3 ++- .../src/gen/java/io/swagger/model/EnumClass.java | 1 + .../src/gen/java/io/swagger/model/EnumTest.java | 3 ++- .../gen/java/io/swagger/model/FormatTest.java | 3 ++- .../java/io/swagger/model/HasOnlyReadOnly.java | 3 ++- .../src/gen/java/io/swagger/model/MapTest.java | 3 ++- ...edPropertiesAndAdditionalPropertiesClass.java | 3 ++- .../java/io/swagger/model/Model200Response.java | 3 ++- .../java/io/swagger/model/ModelApiResponse.java | 3 ++- .../gen/java/io/swagger/model/ModelReturn.java | 3 ++- .../src/gen/java/io/swagger/model/Name.java | 3 ++- .../gen/java/io/swagger/model/NumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/Order.java | 3 ++- .../java/io/swagger/model/OuterComposite.java | 3 ++- .../src/gen/java/io/swagger/model/OuterEnum.java | 1 + .../src/gen/java/io/swagger/model/Pet.java | 3 ++- .../gen/java/io/swagger/model/ReadOnlyFirst.java | 3 ++- .../java/io/swagger/model/SpecialModelName.java | 3 ++- .../src/gen/java/io/swagger/model/Tag.java | 3 ++- .../src/gen/java/io/swagger/model/User.java | 3 ++- .../petstore/jaxrs-spec-interface/swagger.json | 16 ++++++++-------- .../swagger/model/AdditionalPropertiesClass.java | 3 ++- .../src/gen/java/io/swagger/model/Animal.java | 3 ++- .../gen/java/io/swagger/model/AnimalFarm.java | 3 ++- .../swagger/model/ArrayOfArrayOfNumberOnly.java | 3 ++- .../java/io/swagger/model/ArrayOfNumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/ArrayTest.java | 3 ++- .../java/io/swagger/model/Capitalization.java | 3 ++- .../src/gen/java/io/swagger/model/Cat.java | 3 ++- .../src/gen/java/io/swagger/model/Category.java | 3 ++- .../gen/java/io/swagger/model/ClassModel.java | 3 ++- .../src/gen/java/io/swagger/model/Client.java | 3 ++- .../src/gen/java/io/swagger/model/Dog.java | 3 ++- .../gen/java/io/swagger/model/EnumArrays.java | 3 ++- .../src/gen/java/io/swagger/model/EnumClass.java | 1 + .../src/gen/java/io/swagger/model/EnumTest.java | 3 ++- .../gen/java/io/swagger/model/FormatTest.java | 3 ++- .../java/io/swagger/model/HasOnlyReadOnly.java | 3 ++- .../src/gen/java/io/swagger/model/MapTest.java | 3 ++- ...edPropertiesAndAdditionalPropertiesClass.java | 3 ++- .../java/io/swagger/model/Model200Response.java | 3 ++- .../java/io/swagger/model/ModelApiResponse.java | 3 ++- .../gen/java/io/swagger/model/ModelReturn.java | 3 ++- .../src/gen/java/io/swagger/model/Name.java | 3 ++- .../gen/java/io/swagger/model/NumberOnly.java | 3 ++- .../src/gen/java/io/swagger/model/Order.java | 3 ++- .../java/io/swagger/model/OuterComposite.java | 3 ++- .../src/gen/java/io/swagger/model/OuterEnum.java | 1 + .../src/gen/java/io/swagger/model/Pet.java | 3 ++- .../gen/java/io/swagger/model/ReadOnlyFirst.java | 3 ++- .../java/io/swagger/model/SpecialModelName.java | 3 ++- .../src/gen/java/io/swagger/model/Tag.java | 3 ++- .../src/gen/java/io/swagger/model/User.java | 3 ++- samples/server/petstore/jaxrs-spec/swagger.json | 16 ++++++++-------- 70 files changed, 155 insertions(+), 77 deletions(-) create mode 100644 samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java diff --git a/bin/jaxrs-spec-petstore-server-interface.sh b/bin/jaxrs-spec-petstore-server-interface.sh index 3b28a0972f..d47718f278 100755 --- a/bin/jaxrs-spec-petstore-server-interface.sh +++ b/bin/jaxrs-spec-petstore-server-interface.sh @@ -28,6 +28,7 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples/server/petstore/jaxrs-spec-interface -DhideGenerationTimestamp=true +-DserializableModel=true -DinterfaceOnly=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/jaxrs-spec-petstore-server.sh b/bin/jaxrs-spec-petstore-server.sh index 9482e1a897..5350bab881 100755 --- a/bin/jaxrs-spec-petstore-server.sh +++ b/bin/jaxrs-spec-petstore-server.sh @@ -27,6 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs-spec -o samples/server/petstore/jaxrs-spec --DhideGenerationTimestamp=true" +-DhideGenerationTimestamp=true +-DserializableModel=true" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache index 6dd72bcb4e..3fb7e3cfb9 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/model.mustache @@ -2,6 +2,9 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} {{#useBeanValidation}} import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java new file mode 100644 index 0000000000..2561172aea --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java @@ -0,0 +1,9 @@ +package io.swagger.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/") +public class RestApplication extends Application { + +} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 17c61771f7..820bb4a2f1 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass implements Serializable { private @Valid Map mapProperty = new HashMap(); private @Valid Map> mapOfMapProperty = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java index cc18f7fa3a..f7aef656d4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Animal.java @@ -2,6 +2,7 @@ package io.swagger.model; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Animal { +public class Animal implements Serializable { private @Valid String className = null; private @Valid String color = "red"; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java index a730cb5ffc..ca03cafd3e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,6 +3,7 @@ package io.swagger.model; import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList implements Serializable { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 874660a2ef..558c55d50e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly implements Serializable { private @Valid List> arrayArrayNumber = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 2a3980fbd3..780c9bf0df 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly implements Serializable { private @Valid List arrayNumber = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java index ec75158891..f6ef76af0d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,6 +3,7 @@ package io.swagger.model; import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ArrayTest { +public class ArrayTest implements Serializable { private @Valid List arrayOfString = new ArrayList(); private @Valid List> arrayArrayOfInteger = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java index 25bbfd84e3..385c622b0b 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Capitalization.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Capitalization { +public class Capitalization implements Serializable { private @Valid String smallCamel = null; private @Valid String capitalCamel = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java index fc259678da..f334fcd191 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Cat.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Cat extends Animal { +public class Cat extends Animal implements Serializable { private @Valid Boolean declawed = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java index df544c396d..5cee21d040 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Category.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Category { +public class Category implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java index ec28d98861..faa4cf796c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ClassModel.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing model with \"_class\" property") -public class ClassModel { +public class ClassModel implements Serializable { private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java index 57bcea24a4..55a8b4e31c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Client.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Client { +public class Client implements Serializable { private @Valid String client = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java index 529d49d8ce..e55012815c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Dog.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Dog extends Animal { +public class Dog extends Animal implements Serializable { private @Valid String breed = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java index a3bbcc6cd6..afb8028345 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,6 +2,7 @@ package io.swagger.model; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class EnumArrays { +public class EnumArrays implements Serializable { public enum JustSymbolEnum { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java index 4b69436088..13cf0a338e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumClass.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java index 4f7283cdbf..277fcf88e8 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.OuterEnum; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class EnumTest { +public class EnumTest implements Serializable { public enum EnumStringEnum { diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java index faead8afb0..64d0e10f9a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/FormatTest.java @@ -4,6 +4,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class FormatTest { +public class FormatTest implements Serializable { private @Valid Integer integer = null; private @Valid Integer int32 = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index c07f245e60..bef66ba21e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class HasOnlyReadOnly { +public class HasOnlyReadOnly implements Serializable { private @Valid String bar = null; private @Valid String foo = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java index 638058f921..ff256f599d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class MapTest { +public class MapTest implements Serializable { private @Valid Map> mapMapOfString = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0b27795815..d72ca2af08 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -14,7 +15,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { private @Valid UUID uuid = null; private @Valid Date dateTime = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java index 53d4313dfd..aedda176fb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Model200Response.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response implements Serializable { private @Valid Integer name = null; private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java index b21d4f8901..da860040d9 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ModelApiResponse { +public class ModelApiResponse implements Serializable { private @Valid Integer code = null; private @Valid String type = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java index 3e77fb415c..1e17a101c6 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn implements Serializable { private @Valid Integer _return = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java index 775320ca04..1c189b6e01 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Name.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name implements Serializable { private @Valid Integer name = null; private @Valid Integer snakeCase = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java index 631daa797c..edff615a50 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class NumberOnly { +public class NumberOnly implements Serializable { private @Valid BigDecimal justNumber = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java index 344d5055c0..d704247780 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.util.Date; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Order { +public class Order implements Serializable { private @Valid Long id = null; private @Valid Long petId = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java index 28aa1476f3..c038e10589 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class OuterComposite { +public class OuterComposite implements Serializable { private @Valid BigDecimal myNumber = null; private @Valid String myString = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java index eb4b2679eb..d682c3f508 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java index cd025d3bc8..5bad5ba12d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java @@ -4,6 +4,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Pet { +public class Pet implements Serializable { private @Valid Long id = null; private @Valid Category category = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 115bbdef05..0617b6904e 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ReadOnlyFirst { +public class ReadOnlyFirst implements Serializable { private @Valid String bar = null; private @Valid String baz = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java index 08fe6d0186..9afe1f1483 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class SpecialModelName { +public class SpecialModelName implements Serializable { private @Valid Long specialPropertyName = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java index bd9f74287c..35c70dd8bb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Tag.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Tag { +public class Tag implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java index c872137dca..ad92725cb4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/User.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class User { +public class User implements Serializable { private @Valid Long id = null; private @Valid String username = null; diff --git a/samples/server/petstore/jaxrs-spec-interface/swagger.json b/samples/server/petstore/jaxrs-spec-interface/swagger.json index 6812fe6e0e..5b53d7108d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/swagger.json +++ b/samples/server/petstore/jaxrs-spec-interface/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 17c61771f7..820bb4a2f1 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class AdditionalPropertiesClass { +public class AdditionalPropertiesClass implements Serializable { private @Valid Map mapProperty = new HashMap(); private @Valid Map> mapOfMapProperty = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java index cc18f7fa3a..f7aef656d4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Animal.java @@ -2,6 +2,7 @@ package io.swagger.model; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Animal { +public class Animal implements Serializable { private @Valid String className = null; private @Valid String color = "red"; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java index a730cb5ffc..ca03cafd3e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/AnimalFarm.java @@ -3,6 +3,7 @@ package io.swagger.model; import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class AnimalFarm extends ArrayList { +public class AnimalFarm extends ArrayList implements Serializable { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 874660a2ef..558c55d50e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ArrayOfArrayOfNumberOnly { +public class ArrayOfArrayOfNumberOnly implements Serializable { private @Valid List> arrayArrayNumber = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 2a3980fbd3..780c9bf0df 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ArrayOfNumberOnly { +public class ArrayOfNumberOnly implements Serializable { private @Valid List arrayNumber = new ArrayList(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java index ec75158891..f6ef76af0d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ArrayTest.java @@ -3,6 +3,7 @@ package io.swagger.model; import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ArrayTest { +public class ArrayTest implements Serializable { private @Valid List arrayOfString = new ArrayList(); private @Valid List> arrayArrayOfInteger = new ArrayList>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java index 25bbfd84e3..385c622b0b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Capitalization.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Capitalization { +public class Capitalization implements Serializable { private @Valid String smallCamel = null; private @Valid String capitalCamel = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java index fc259678da..f334fcd191 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Cat.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Cat extends Animal { +public class Cat extends Animal implements Serializable { private @Valid Boolean declawed = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java index df544c396d..5cee21d040 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Category.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Category { +public class Category implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java index ec28d98861..faa4cf796c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ClassModel.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing model with \"_class\" property") -public class ClassModel { +public class ClassModel implements Serializable { private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java index 57bcea24a4..55a8b4e31c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Client.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Client { +public class Client implements Serializable { private @Valid String client = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java index 529d49d8ce..e55012815c 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Dog.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.Animal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Dog extends Animal { +public class Dog extends Animal implements Serializable { private @Valid String breed = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java index a3bbcc6cd6..afb8028345 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -2,6 +2,7 @@ package io.swagger.model; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -10,7 +11,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class EnumArrays { +public class EnumArrays implements Serializable { public enum JustSymbolEnum { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java index 4b69436088..13cf0a338e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumClass.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java index 4f7283cdbf..277fcf88e8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.model.OuterEnum; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class EnumTest { +public class EnumTest implements Serializable { public enum EnumStringEnum { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java index faead8afb0..64d0e10f9a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/FormatTest.java @@ -4,6 +4,7 @@ import java.math.BigDecimal; import java.util.Date; import java.util.UUID; import org.joda.time.LocalDate; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class FormatTest { +public class FormatTest implements Serializable { private @Valid Integer integer = null; private @Valid Integer int32 = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index c07f245e60..bef66ba21e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class HasOnlyReadOnly { +public class HasOnlyReadOnly implements Serializable { private @Valid String bar = null; private @Valid String foo = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java index 638058f921..ff256f599d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -3,6 +3,7 @@ package io.swagger.model; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -11,7 +12,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class MapTest { +public class MapTest implements Serializable { private @Valid Map> mapMapOfString = new HashMap>(); diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0b27795815..d72ca2af08 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -6,6 +6,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -14,7 +15,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class MixedPropertiesAndAdditionalPropertiesClass { +public class MixedPropertiesAndAdditionalPropertiesClass implements Serializable { private @Valid UUID uuid = null; private @Valid Date dateTime = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java index 53d4313dfd..aedda176fb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Model200Response.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing model name starting with number") -public class Model200Response { +public class Model200Response implements Serializable { private @Valid Integer name = null; private @Valid String propertyClass = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java index b21d4f8901..da860040d9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ModelApiResponse { +public class ModelApiResponse implements Serializable { private @Valid Integer code = null; private @Valid String type = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java index 3e77fb415c..1e17a101c6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelReturn.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing reserved words") -public class ModelReturn { +public class ModelReturn implements Serializable { private @Valid Integer _return = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java index 775320ca04..1c189b6e01 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Name.java @@ -1,6 +1,7 @@ package io.swagger.model; import io.swagger.annotations.ApiModel; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; @ApiModel(description = "Model for testing model name same as property name") -public class Name { +public class Name implements Serializable { private @Valid Integer name = null; private @Valid Integer snakeCase = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java index 631daa797c..edff615a50 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/NumberOnly.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class NumberOnly { +public class NumberOnly implements Serializable { private @Valid BigDecimal justNumber = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index 344d5055c0..d704247780 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.util.Date; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Order { +public class Order implements Serializable { private @Valid Long id = null; private @Valid Long petId = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java index 28aa1476f3..c038e10589 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterComposite.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -9,7 +10,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class OuterComposite { +public class OuterComposite implements Serializable { private @Valid BigDecimal myNumber = null; private @Valid String myString = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java index eb4b2679eb..d682c3f508 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/OuterEnum.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java index cd025d3bc8..5bad5ba12d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java @@ -4,6 +4,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -12,7 +13,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Pet { +public class Pet implements Serializable { private @Valid Long id = null; private @Valid Category category = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 115bbdef05..0617b6904e 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class ReadOnlyFirst { +public class ReadOnlyFirst implements Serializable { private @Valid String bar = null; private @Valid String baz = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java index 08fe6d0186..9afe1f1483 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/SpecialModelName.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class SpecialModelName { +public class SpecialModelName implements Serializable { private @Valid Long specialPropertyName = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java index bd9f74287c..35c70dd8bb 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Tag.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class Tag { +public class Tag implements Serializable { private @Valid Long id = null; private @Valid String name = null; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java index c872137dca..ad92725cb4 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/User.java @@ -1,5 +1,6 @@ package io.swagger.model; +import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -8,7 +9,7 @@ import io.swagger.annotations.*; import java.util.Objects; -public class User { +public class User implements Serializable { private @Valid Long id = null; private @Valid String username = null; diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 6812fe6e0e..5b53d7108d 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -680,8 +680,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -699,8 +699,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -718,8 +718,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string",