Add Serializable import to JaxRS-spec models if serializableModel is set (#6651)

This commit is contained in:
Graham Johnson 2017-10-10 08:45:47 -06:00 committed by wing328
parent 676af62122
commit 1bdb104738
70 changed files with 155 additions and 77 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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 {
}

View File

@ -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<String, String> mapProperty = new HashMap<String, String>();
private @Valid Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();

View File

@ -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";

View File

@ -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<Animal> {
public class AnimalFarm extends ArrayList<Animal> implements Serializable {

View File

@ -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<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();

View File

@ -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<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();

View File

@ -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<String> arrayOfString = new ArrayList<String>();
private @Valid List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -1,5 +1,6 @@
package io.swagger.model;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,5 +1,6 @@
package io.swagger.model;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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",

View File

@ -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<String, String> mapProperty = new HashMap<String, String>();
private @Valid Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();

View File

@ -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";

View File

@ -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<Animal> {
public class AnimalFarm extends ArrayList<Animal> implements Serializable {

View File

@ -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<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();

View File

@ -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<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();

View File

@ -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<String> arrayOfString = new ArrayList<String>();
private @Valid List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -1,5 +1,6 @@
package io.swagger.model;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,5 +1,6 @@
package io.swagger.model;
import java.io.Serializable;
import javax.validation.constraints.*;
import javax.validation.Valid;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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",