From 1339222bbcbfc0a10c75e910e92557143cbc5464 Mon Sep 17 00:00:00 2001 From: Matan Rubin Date: Tue, 7 Feb 2017 13:35:11 +0200 Subject: [PATCH 1/3] [Java][Issue #1806] generate using java.util.UUID for UUIDs Before this change if a model had a property of type=string and format=uuid, it would be generated as a Java String. Now, it generates the property as java.util.UUID. --- .../swagger/codegen/languages/AbstractJavaCodegen.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 5fb8b7e643f..8f97b524d7b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -120,7 +120,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code instantiationTypes.put("map", "HashMap"); typeMapping.put("date", "Date"); typeMapping.put("file", "File"); - typeMapping.put("UUID", "String"); cliOptions.add(new CliOption(CodegenConstants.MODEL_PACKAGE, CodegenConstants.MODEL_PACKAGE_DESC)); cliOptions.add(new CliOption(CodegenConstants.API_PACKAGE, CodegenConstants.API_PACKAGE_DESC)); @@ -400,7 +399,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code } @Override - public String escapeReservedWord(String name) { + public String escapeReservedWord(String name) { if(this.reservedWordsMappings().containsKey(name)) { return this.reservedWordsMappings().get(name); } @@ -1126,7 +1125,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public String toRegularExpression(String pattern) { return escapeText(pattern); } - + public boolean convertPropertyToBoolean(String propertyKey) { boolean booleanValue = false; if (additionalProperties.containsKey(propertyKey)) { @@ -1135,7 +1134,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code return booleanValue; } - + public void writePropertyBack(String propertyKey, boolean value) { additionalProperties.put(propertyKey, value); } @@ -1143,6 +1142,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code @Override public String sanitizeTag(String tag) { return camelize(sanitizeName(tag)); - } + } } From 882c3ecba54906e9020137f0f145a16dc940fcf6 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 8 Feb 2017 16:07:09 +0800 Subject: [PATCH 2/3] update java petstore with new uuid mapping --- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../petstore/java/jersey1/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../java/jersey2-java8/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../petstore/java/jersey2/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../petstore/java/okhttp-gson/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../java/retrofit2-play24/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 15 +++++++++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../petstore/java/retrofit2/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- .../petstore/java/retrofit2rx/docs/FormatTest.md | 2 +- ...MixedPropertiesAndAdditionalPropertiesClass.md | 2 +- .../java/io/swagger/client/model/FormatTest.java | 9 +++++---- ...xedPropertiesAndAdditionalPropertiesClass.java | 9 +++++---- 32 files changed, 110 insertions(+), 86 deletions(-) diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java index 63130ade905..b54f66cdfd0 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -61,7 +62,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -274,7 +275,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -284,11 +285,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26829e752dd..8ece04d15e1 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -30,7 +31,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -38,7 +39,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -48,11 +49,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/jersey1/docs/FormatTest.md b/samples/client/petstore/java/jersey1/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/jersey1/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey1/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java index 63130ade905..b54f66cdfd0 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -61,7 +62,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -274,7 +275,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -284,11 +285,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26829e752dd..8ece04d15e1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -30,7 +31,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -38,7 +39,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -48,11 +49,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md b/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md index ba089e5a561..c7a3acb3cb7 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md index c0bc277c74c..b12e2cd70e6 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java index aacde8ace39..0904135b735 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.UUID; /** * FormatTest @@ -61,7 +62,7 @@ public class FormatTest { private OffsetDateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -274,7 +275,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -284,11 +285,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5320749fd34..b62601da3ef 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,6 +23,7 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -30,7 +31,7 @@ import java.util.Map; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private OffsetDateTime dateTime = null; @@ -38,7 +39,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -48,11 +49,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/jersey2/docs/FormatTest.md b/samples/client/petstore/java/jersey2/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/jersey2/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java index 63130ade905..b54f66cdfd0 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -61,7 +62,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -274,7 +275,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -284,11 +285,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 26829e752dd..8ece04d15e1 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -30,7 +31,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -38,7 +39,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -48,11 +49,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java index 287c083b188..b79593fdb6a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -60,7 +61,7 @@ public class FormatTest { private DateTime dateTime = null; @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("password") private String password = null; @@ -273,7 +274,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -283,11 +284,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 20644318886..89fce6dad9e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -21,6 +21,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -29,7 +30,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("dateTime") private DateTime dateTime = null; @@ -37,7 +38,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -47,11 +48,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java index 287c083b188..b79593fdb6a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -60,7 +61,7 @@ public class FormatTest { private DateTime dateTime = null; @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("password") private String password = null; @@ -273,7 +274,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -283,11 +284,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 20644318886..89fce6dad9e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -21,6 +21,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -29,7 +30,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("dateTime") private DateTime dateTime = null; @@ -37,7 +38,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -47,11 +48,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md b/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java index 8f20e7c3ae5..d060850d48a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/FormatTest.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; import javax.validation.constraints.*; @@ -62,7 +63,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -141,6 +142,8 @@ public class FormatTest { * @return number **/ @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") @ApiModelProperty(example = "null", required = true, value = "") public BigDecimal getNumber() { return number; @@ -161,6 +164,8 @@ public class FormatTest { * maximum: 987.6 * @return _float **/ + @DecimalMin("54.3") + @DecimalMax("987.6") @ApiModelProperty(example = "null", value = "") public Float getFloat() { return _float; @@ -181,6 +186,8 @@ public class FormatTest { * maximum: 123.4 * @return _double **/ + @DecimalMin("67.8") + @DecimalMax("123.4") @ApiModelProperty(example = "null", value = "") public Double getDouble() { return _double; @@ -283,7 +290,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -293,11 +300,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 536edaea064..de5512b1652 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; import javax.validation.constraints.*; @@ -31,7 +32,7 @@ import javax.validation.constraints.*; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -39,7 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -49,11 +50,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit2/docs/FormatTest.md b/samples/client/petstore/java/retrofit2/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/retrofit2/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java index 287c083b188..b79593fdb6a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -60,7 +61,7 @@ public class FormatTest { private DateTime dateTime = null; @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("password") private String password = null; @@ -273,7 +274,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -283,11 +284,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 20644318886..89fce6dad9e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -21,6 +21,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -29,7 +30,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("dateTime") private DateTime dateTime = null; @@ -37,7 +38,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -47,11 +48,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md index 44de7d9511a..06bed417232 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md @@ -15,7 +15,7 @@ Name | Type | Description | Notes **binary** | **byte[]** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | diff --git a/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md index e3487bcc501..349afef35a9 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **dateTime** | [**DateTime**](DateTime.md) | | [optional] **map** | [**Map<String, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java index 287c083b188..b79593fdb6a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/FormatTest.java @@ -18,6 +18,7 @@ import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -60,7 +61,7 @@ public class FormatTest { private DateTime dateTime = null; @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("password") private String password = null; @@ -273,7 +274,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -283,11 +284,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 20644318886..89fce6dad9e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -21,6 +21,7 @@ import io.swagger.client.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; /** @@ -29,7 +30,7 @@ import org.joda.time.DateTime; public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("uuid") - private String uuid = null; + private UUID uuid = null; @SerializedName("dateTime") private DateTime dateTime = null; @@ -37,7 +38,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @SerializedName("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -47,11 +48,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } From beadd6d740ef555242377116a1de531488151c91 Mon Sep 17 00:00:00 2001 From: wing328 Date: Wed, 8 Feb 2017 16:39:02 +0800 Subject: [PATCH 3/3] update java server stub samples with new uuid mapping --- .../gen/java/io/swagger/model/FormatTest.java | 9 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 9 ++-- .../gen/java/io/swagger/model/FormatTest.java | 9 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 9 ++-- .../gen/java/io/swagger/model/FormatTest.java | 9 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 9 ++-- .../gen/java/io/swagger/model/FormatTest.java | 9 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 9 ++-- .../petstore/spring-mvc-j8-async/pom.xml | 7 ++++ .../src/main/java/io/swagger/api/FakeApi.java | 8 ++-- .../io/swagger/api/FakeApiController.java | 2 +- .../src/main/java/io/swagger/api/PetApi.java | 6 +-- .../java/io/swagger/api/PetApiController.java | 2 +- .../main/java/io/swagger/api/StoreApi.java | 4 +- .../io/swagger/api/StoreApiController.java | 2 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +-- .../io/swagger/api/UserApiController.java | 2 +- .../model/AdditionalPropertiesClass.java | 2 +- .../main/java/io/swagger/model/Animal.java | 3 +- .../java/io/swagger/model/AnimalFarm.java | 2 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../main/java/io/swagger/model/ArrayTest.java | 2 +- .../java/io/swagger/model/Capitalization.java | 2 +- .../src/main/java/io/swagger/model/Cat.java | 2 +- .../main/java/io/swagger/model/Category.java | 2 +- .../java/io/swagger/model/ClassModel.java | 2 +- .../main/java/io/swagger/model/Client.java | 2 +- .../src/main/java/io/swagger/model/Dog.java | 2 +- .../java/io/swagger/model/EnumArrays.java | 2 +- .../main/java/io/swagger/model/EnumClass.java | 2 +- .../main/java/io/swagger/model/EnumTest.java | 2 +- .../java/io/swagger/model/FormatTest.java | 27 +++++++++--- .../io/swagger/model/HasOnlyReadOnly.java | 2 +- .../main/java/io/swagger/model/MapTest.java | 2 +- ...ropertiesAndAdditionalPropertiesClass.java | 11 ++--- .../io/swagger/model/Model200Response.java | 2 +- .../io/swagger/model/ModelApiResponse.java | 2 +- .../java/io/swagger/model/ModelReturn.java | 2 +- .../src/main/java/io/swagger/model/Name.java | 3 +- .../java/io/swagger/model/NumberOnly.java | 2 +- .../src/main/java/io/swagger/model/Order.java | 2 +- .../main/java/io/swagger/model/OuterEnum.java | 2 +- .../src/main/java/io/swagger/model/Pet.java | 4 +- .../java/io/swagger/model/ReadOnlyFirst.java | 2 +- .../io/swagger/model/SpecialModelName.java | 2 +- .../src/main/java/io/swagger/model/Tag.java | 2 +- .../src/main/java/io/swagger/model/User.java | 2 +- samples/server/petstore/spring-mvc/pom.xml | 4 +- .../io/swagger/api/FakeApiController.java | 6 +-- .../main/java/io/swagger/api/StoreApi.java | 2 +- .../io/swagger/api/StoreApiController.java | 4 +- .../java/io/swagger/model/Capitalization.java | 2 +- .../java/io/swagger/model/FormatTest.java | 9 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 9 ++-- .../petstore/springboot-delegate-j8/pom.xml | 7 ++++ .../src/main/java/io/swagger/api/FakeApi.java | 8 ++-- .../io/swagger/api/FakeApiController.java | 8 ++-- .../src/main/java/io/swagger/api/PetApi.java | 6 +-- .../java/io/swagger/api/PetApiController.java | 6 +-- .../main/java/io/swagger/api/StoreApi.java | 4 +- .../io/swagger/api/StoreApiController.java | 4 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +-- .../io/swagger/api/UserApiController.java | 6 +-- .../model/AdditionalPropertiesClass.java | 2 +- .../main/java/io/swagger/model/Animal.java | 3 +- .../java/io/swagger/model/AnimalFarm.java | 2 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../main/java/io/swagger/model/ArrayTest.java | 2 +- .../java/io/swagger/model/Capitalization.java | 2 +- .../src/main/java/io/swagger/model/Cat.java | 2 +- .../main/java/io/swagger/model/Category.java | 2 +- .../java/io/swagger/model/ClassModel.java | 2 +- .../main/java/io/swagger/model/Client.java | 2 +- .../src/main/java/io/swagger/model/Dog.java | 2 +- .../java/io/swagger/model/EnumArrays.java | 2 +- .../main/java/io/swagger/model/EnumClass.java | 2 +- .../main/java/io/swagger/model/EnumTest.java | 2 +- .../java/io/swagger/model/FormatTest.java | 27 +++++++++--- .../io/swagger/model/HasOnlyReadOnly.java | 2 +- .../main/java/io/swagger/model/MapTest.java | 2 +- ...ropertiesAndAdditionalPropertiesClass.java | 11 ++--- .../io/swagger/model/Model200Response.java | 2 +- .../io/swagger/model/ModelApiResponse.java | 2 +- .../java/io/swagger/model/ModelReturn.java | 2 +- .../src/main/java/io/swagger/model/Name.java | 3 +- .../java/io/swagger/model/NumberOnly.java | 2 +- .../src/main/java/io/swagger/model/Order.java | 2 +- .../main/java/io/swagger/model/OuterEnum.java | 2 +- .../src/main/java/io/swagger/model/Pet.java | 4 +- .../java/io/swagger/model/ReadOnlyFirst.java | 2 +- .../io/swagger/model/SpecialModelName.java | 2 +- .../src/main/java/io/swagger/model/Tag.java | 2 +- .../src/main/java/io/swagger/model/User.java | 2 +- .../petstore/springboot-delegate/pom.xml | 7 ++++ .../src/main/java/io/swagger/api/FakeApi.java | 8 ++-- .../io/swagger/api/FakeApiController.java | 8 ++-- .../src/main/java/io/swagger/api/PetApi.java | 6 +-- .../java/io/swagger/api/PetApiController.java | 6 +-- .../main/java/io/swagger/api/StoreApi.java | 4 +- .../io/swagger/api/StoreApiController.java | 4 +- .../src/main/java/io/swagger/api/UserApi.java | 6 +-- .../io/swagger/api/UserApiController.java | 6 +-- .../model/AdditionalPropertiesClass.java | 2 +- .../main/java/io/swagger/model/Animal.java | 3 +- .../java/io/swagger/model/AnimalFarm.java | 2 +- .../model/ArrayOfArrayOfNumberOnly.java | 2 +- .../io/swagger/model/ArrayOfNumberOnly.java | 2 +- .../main/java/io/swagger/model/ArrayTest.java | 2 +- .../java/io/swagger/model/Capitalization.java | 2 +- .../src/main/java/io/swagger/model/Cat.java | 2 +- .../main/java/io/swagger/model/Category.java | 2 +- .../java/io/swagger/model/ClassModel.java | 2 +- .../main/java/io/swagger/model/Client.java | 2 +- .../src/main/java/io/swagger/model/Dog.java | 2 +- .../java/io/swagger/model/EnumArrays.java | 2 +- .../main/java/io/swagger/model/EnumClass.java | 2 +- .../main/java/io/swagger/model/EnumTest.java | 2 +- .../java/io/swagger/model/FormatTest.java | 27 +++++++++--- .../io/swagger/model/HasOnlyReadOnly.java | 2 +- .../main/java/io/swagger/model/MapTest.java | 2 +- ...ropertiesAndAdditionalPropertiesClass.java | 11 ++--- .../io/swagger/model/Model200Response.java | 2 +- .../io/swagger/model/ModelApiResponse.java | 2 +- .../java/io/swagger/model/ModelReturn.java | 2 +- .../src/main/java/io/swagger/model/Name.java | 3 +- .../java/io/swagger/model/NumberOnly.java | 2 +- .../src/main/java/io/swagger/model/Order.java | 2 +- .../main/java/io/swagger/model/OuterEnum.java | 2 +- .../src/main/java/io/swagger/model/Pet.java | 4 +- .../java/io/swagger/model/ReadOnlyFirst.java | 2 +- .../io/swagger/model/SpecialModelName.java | 2 +- .../src/main/java/io/swagger/model/Tag.java | 2 +- .../src/main/java/io/swagger/model/User.java | 2 +- samples/server/petstore/springboot/pom.xml | 6 +-- .../src/main/java/io/swagger/api/PetApi.java | 41 +++++++++---------- .../java/io/swagger/api/PetApiController.java | 17 ++++---- .../main/java/io/swagger/api/StoreApi.java | 12 +++--- .../io/swagger/api/StoreApiController.java | 4 +- .../src/main/java/io/swagger/api/UserApi.java | 28 ++++++------- .../io/swagger/api/UserApiController.java | 12 +++--- .../SwaggerDocumentationConfig.java | 4 +- .../java/io/swagger/model/Capitalization.java | 2 +- .../java/io/swagger/model/FormatTest.java | 9 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 9 ++-- .../src/main/java/io/swagger/model/Order.java | 2 +- 147 files changed, 401 insertions(+), 302 deletions(-) diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java index 121a8c69aed..d544cfa112f 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/FormatTest.java @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.LocalDate; import javax.validation.constraints.*; @@ -38,7 +39,7 @@ public class FormatTest { @ApiModelProperty(example = "null", value = "") private javax.xml.datatype.XMLGregorianCalendar dateTime = null; @ApiModelProperty(example = "null", value = "") - private String uuid = null; + private UUID uuid = null; @ApiModelProperty(example = "null", required = true, value = "") private String password = null; @@ -257,15 +258,15 @@ public class FormatTest { * Get uuid * @return uuid **/ - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 99dc61a32cb..2dcc59c4803 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -4,6 +4,7 @@ import io.swagger.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.validation.constraints.*; import io.swagger.annotations.ApiModelProperty; @@ -18,7 +19,7 @@ import javax.xml.bind.annotation.XmlEnumValue; public class MixedPropertiesAndAdditionalPropertiesClass { @ApiModelProperty(example = "null", value = "") - private String uuid = null; + private UUID uuid = null; @ApiModelProperty(example = "null", value = "") private javax.xml.datatype.XMLGregorianCalendar dateTime = null; @ApiModelProperty(example = "null", value = "") @@ -28,15 +29,15 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * Get uuid * @return uuid **/ - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } 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 825e8305447..b11fec88aab 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 @@ -1,6 +1,7 @@ package io.swagger.model; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.LocalDate; import javax.validation.constraints.*; @@ -22,7 +23,7 @@ public class FormatTest { private byte[] binary = null; private LocalDate date = null; private javax.xml.datatype.XMLGregorianCalendar dateTime = null; - private String uuid = null; + private UUID uuid = null; private String password = null; /** @@ -227,17 +228,17 @@ public class FormatTest { /** **/ - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } 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 ea3a99d84bc..6c4654ce3a5 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 @@ -4,6 +4,7 @@ import io.swagger.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.validation.constraints.*; @@ -13,23 +14,23 @@ import java.util.Objects; public class MixedPropertiesAndAdditionalPropertiesClass { - private String uuid = null; + private UUID uuid = null; private javax.xml.datatype.XMLGregorianCalendar dateTime = null; private Map map = new HashMap(); /** **/ - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @ApiModelProperty(example = "null", value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java index 973afef18fe..eaba5daefe7 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Date; +import java.util.UUID; import javax.validation.constraints.*; /** @@ -61,7 +62,7 @@ public class FormatTest { private Date dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -299,7 +300,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -310,11 +311,11 @@ public class FormatTest { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4b699fe821a..16c430d3242 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,6 +23,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.validation.constraints.*; /** @@ -31,7 +32,7 @@ import javax.validation.constraints.*; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private Date dateTime = null; @@ -39,7 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -50,11 +51,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java index 973afef18fe..eaba5daefe7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Date; +import java.util.UUID; import javax.validation.constraints.*; /** @@ -61,7 +62,7 @@ public class FormatTest { private Date dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -299,7 +300,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -310,11 +311,11 @@ public class FormatTest { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 4b699fe821a..16c430d3242 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -23,6 +23,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import javax.validation.constraints.*; /** @@ -31,7 +32,7 @@ import javax.validation.constraints.*; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private Date dateTime = null; @@ -39,7 +40,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -50,11 +51,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index d79b6aba9da..68a727affbb 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -117,6 +117,13 @@ servlet-api ${servlet-api-version} + + + javax.validation + validation-api + 1.1.0.Final + provided + 1.8 diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index 0e6a9276c38..9590001aab3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -19,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.concurrent.CompletableFuture; - +import javax.validation.constraints.*; @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -78,9 +78,9 @@ public interface FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApiController.java index 1c9b2129632..bcba1b5fdde 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApiController.java @@ -2,7 +2,7 @@ package io.swagger.api; import org.springframework.stereotype.Controller; - +import javax.validation.constraints.*; @Controller public class FakeApiController implements FakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index 3727f1898c7..fd5b2c93f82 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.concurrent.CompletableFuture; - +import javax.validation.constraints.*; @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -71,7 +71,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture>> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + default CompletableFuture>> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity>(HttpStatus.OK)); } @@ -89,7 +89,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture>> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + default CompletableFuture>> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity>(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApiController.java index 158ab5bae23..13c57a67635 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApiController.java @@ -2,7 +2,7 @@ package io.swagger.api; import org.springframework.stereotype.Controller; - +import javax.validation.constraints.*; @Controller public class PetApiController implements PetApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index a1afe015a29..b99481c2aff 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.concurrent.CompletableFuture; - +import javax.validation.constraints.*; @Api(value = "store", description = "the store API") public interface StoreApi { @@ -57,7 +57,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + default CompletableFuture> getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApiController.java index a0afb7c9b74..408cb9e7ae5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApiController.java @@ -2,7 +2,7 @@ package io.swagger.api; import org.springframework.stereotype.Controller; - +import javax.validation.constraints.*; @Controller public class StoreApiController implements StoreApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index 919e67d2cab..2b539a21966 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.concurrent.CompletableFuture; - +import javax.validation.constraints.*; @Api(value = "user", description = "the user API") public interface UserApi { @@ -92,8 +92,8 @@ public interface UserApi { @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture> loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default CompletableFuture> loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return CompletableFuture.completedFuture(new ResponseEntity(HttpStatus.OK)); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApiController.java index fa09b8491d6..4f13d0d9ba3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApiController.java @@ -2,7 +2,7 @@ package io.swagger.api; import org.springframework.stereotype.Controller; - +import javax.validation.constraints.*; @Controller public class UserApiController implements UserApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index f74f7d3d882..81535e041fa 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.validation.constraints.*; /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java index 36c209fb93b..a218f0b5542 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Animal */ @@ -34,6 +34,7 @@ public class Animal { * @return className **/ @ApiModelProperty(required = true, value = "") + @NotNull public String getClassName() { return className; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java index c2b0084d9cd..33dc04699af 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java @@ -4,7 +4,7 @@ import java.util.Objects; import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * AnimalFarm */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 803eb69e16a..3be691e4d95 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index bebc2470927..12196897345 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java index 19464a99acd..a26a1600287 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java index 94cb9977104..d7ad5642ccf 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java index 95bea570923..747e5dc0c7e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; - +import javax.validation.constraints.*; /** * Cat */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java index ba1ecfdb2b8..9629da6500e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Category */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java index 16c743e4f32..d69acffefa8 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java index fcb2b0a8340..f9cec5a225e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Client */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java index f8072688756..9057e840fc3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; - +import javax.validation.constraints.*; /** * Dog */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java index 959b35e6b13..97ab6f6410e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * EnumArrays */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumClass.java index d8ac42c4872..cdfc0933c3e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumClass.java @@ -2,7 +2,7 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; - +import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java index d081e726855..9f2a0275a6a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; - +import javax.validation.constraints.*; /** * EnumTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java index 74cf9dda458..fc491c68d6b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java @@ -8,7 +8,8 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; - +import java.util.UUID; +import javax.validation.constraints.*; /** * FormatTest */ @@ -48,7 +49,7 @@ public class FormatTest { private OffsetDateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -65,6 +66,8 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") + @Min(10) + @Max(100) public Integer getInteger() { return integer; } @@ -85,6 +88,8 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") + @Min(20) + @Max(200) public Integer getInt32() { return int32; } @@ -123,6 +128,9 @@ public class FormatTest { * @return number **/ @ApiModelProperty(required = true, value = "") + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -143,6 +151,8 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") + @DecimalMin("54.3") + @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -163,6 +173,8 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") + @DecimalMin("67.8") + @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -181,6 +193,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -199,6 +212,7 @@ public class FormatTest { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @NotNull public byte[] getByte() { return _byte; } @@ -235,6 +249,7 @@ public class FormatTest { * @return date **/ @ApiModelProperty(required = true, value = "") + @NotNull public LocalDate getDate() { return date; } @@ -261,7 +276,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -271,11 +286,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -289,6 +304,8 @@ public class FormatTest { * @return password **/ @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java index df5c0624a4c..a26492e4912 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java index 9ef30a045d0..9a0566a8dd1 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java @@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.validation.constraints.*; /** * MapTest */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index ea443a94338..31f364f2497 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,14 +10,15 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; - +import java.util.UUID; +import javax.validation.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private OffsetDateTime dateTime = null; @@ -25,7 +26,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -35,11 +36,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java index 09ad4d0d60e..4d47f6c03c9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java index 82f447004ee..36da9b20d9d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * ModelApiResponse */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java index 884a45c598e..7ffc24a0144 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing reserved words */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java index 88526226b78..953199166ff 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model name same as property name */ @@ -34,6 +34,7 @@ public class Name { * @return name **/ @ApiModelProperty(required = true, value = "") + @NotNull public Integer getName() { return name; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java index 9424f7a4b5e..e6dbf3139e2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - +import javax.validation.constraints.*; /** * NumberOnly */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java index cee3ae6d708..d65ed713151 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; - +import javax.validation.constraints.*; /** * Order */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterEnum.java index 0abc3d063b5..5f0075e4457 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterEnum.java @@ -2,7 +2,7 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; - +import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java index 823d25e05a0..9adc708de71 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java @@ -10,7 +10,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * Pet */ @@ -113,6 +113,7 @@ public class Pet { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull public String getName() { return name; } @@ -136,6 +137,7 @@ public class Pet { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @NotNull public List getPhotoUrls() { return photoUrls; } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java index 217cc653189..47700659fd2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java index 2cdc99de90e..880d70599b0 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * SpecialModelName */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java index 846812a5031..298085317a4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Tag */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java index 52c5fff826e..8e40f7e0594 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * User */ diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index d9cdcd13ffe..b94b4ddd2f8 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -1,9 +1,9 @@ 4.0.0 io.swagger - swagger-spring + swagger-spring-mvc-server jar - swagger-spring + swagger-spring-mvc-server 1.0.0 src/main/java diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java index 908cdf938ad..b1225a72bc5 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApiController.java @@ -53,9 +53,9 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index 9ef45be0228..47c2c561ff1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -27,7 +27,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) - ResponseEntity deleteOrder( @Min(1)@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); + ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java index 2178b812a2f..97a1b7e5129 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApiController.java @@ -22,7 +22,9 @@ import javax.validation.constraints.*; @Controller public class StoreApiController implements StoreApi { - public ResponseEntity deleteOrder( @Min(1)@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { + + + public ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java index 94cb9977104..d7ad5642ccf 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Capitalization */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java index d48282d2d73..aed8db1ed96 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; import javax.validation.constraints.*; @@ -48,7 +49,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -275,7 +276,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -285,11 +286,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9ead927c389..2cb9928d5fe 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -9,6 +9,7 @@ import io.swagger.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; import javax.validation.constraints.*; /** @@ -17,7 +18,7 @@ import javax.validation.constraints.*; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -25,7 +26,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -35,11 +36,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index fba801c6b4e..959f4187056 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -58,5 +58,12 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 + + + javax.validation + validation-api + 1.1.0.Final + provided + \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java index 517676dd81a..cbdd93952b8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApi.java @@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -77,9 +77,9 @@ public interface FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { // do some magic! return new ResponseEntity(HttpStatus.OK); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java index 1f50d06a2f3..6e162ee2183 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/FakeApiController.java @@ -19,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class FakeApiController implements FakeApi { @@ -58,9 +58,9 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { // do some magic! return delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java index d1bd561ef8f..7ffb559205b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApi.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -70,7 +70,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + default ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { // do some magic! return new ResponseEntity>(HttpStatus.OK); } @@ -88,7 +88,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { // do some magic! return new ResponseEntity>(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java index 6eb175b89f0..03c23df7b47 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/PetApiController.java @@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class PetApiController implements PetApi { @@ -41,12 +41,12 @@ public class PetApiController implements PetApi { return delegate.deletePet(petId, apiKey); } - public ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { // do some magic! return delegate.findPetsByStatus(status); } - public ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { // do some magic! return delegate.findPetsByTags(tags); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java index 2827642886a..2c1ad770b52 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApi.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "store", description = "the store API") public interface StoreApi { @@ -56,7 +56,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + default ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java index 6215ded3540..050a9d7de74 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/StoreApiController.java @@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class StoreApiController implements StoreApi { @@ -39,7 +39,7 @@ public class StoreApiController implements StoreApi { return delegate.getInventory(); } - public ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { // do some magic! return delegate.getOrderById(orderId); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java index bcc8700bed1..384f944c78f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApi.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "user", description = "the user API") public interface UserApi { @@ -91,8 +91,8 @@ public interface UserApi { @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + default ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java index 7cb74a3e172..785e28f4509 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/api/UserApiController.java @@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class UserApiController implements UserApi { @@ -54,8 +54,8 @@ public class UserApiController implements UserApi { return delegate.getUserByName(username); } - public ResponseEntity loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + public ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return delegate.loginUser(username, password); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index f74f7d3d882..81535e041fa 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.validation.constraints.*; /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Animal.java index 36c209fb93b..a218f0b5542 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Animal.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Animal */ @@ -34,6 +34,7 @@ public class Animal { * @return className **/ @ApiModelProperty(required = true, value = "") + @NotNull public String getClassName() { return className; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AnimalFarm.java index c2b0084d9cd..33dc04699af 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/AnimalFarm.java @@ -4,7 +4,7 @@ import java.util.Objects; import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * AnimalFarm */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 803eb69e16a..3be691e4d95 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index bebc2470927..12196897345 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java index 19464a99acd..a26a1600287 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ArrayTest.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Capitalization.java index 94cb9977104..d7ad5642ccf 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Capitalization.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Capitalization */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Cat.java index 95bea570923..747e5dc0c7e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Cat.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; - +import javax.validation.constraints.*; /** * Cat */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Category.java index ba1ecfdb2b8..9629da6500e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Category.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Category */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ClassModel.java index 16c743e4f32..d69acffefa8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ClassModel.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Client.java index fcb2b0a8340..f9cec5a225e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Client.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Client */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Dog.java index f8072688756..9057e840fc3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Dog.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; - +import javax.validation.constraints.*; /** * Dog */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java index 959b35e6b13..97ab6f6410e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumArrays.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumClass.java index d8ac42c4872..cdfc0933c3e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumClass.java @@ -2,7 +2,7 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; - +import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumTest.java index d081e726855..9f2a0275a6a 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/EnumTest.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; - +import javax.validation.constraints.*; /** * EnumTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java index 74cf9dda458..fc491c68d6b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/FormatTest.java @@ -8,7 +8,8 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; - +import java.util.UUID; +import javax.validation.constraints.*; /** * FormatTest */ @@ -48,7 +49,7 @@ public class FormatTest { private OffsetDateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -65,6 +66,8 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") + @Min(10) + @Max(100) public Integer getInteger() { return integer; } @@ -85,6 +88,8 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") + @Min(20) + @Max(200) public Integer getInt32() { return int32; } @@ -123,6 +128,9 @@ public class FormatTest { * @return number **/ @ApiModelProperty(required = true, value = "") + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -143,6 +151,8 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") + @DecimalMin("54.3") + @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -163,6 +173,8 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") + @DecimalMin("67.8") + @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -181,6 +193,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -199,6 +212,7 @@ public class FormatTest { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @NotNull public byte[] getByte() { return _byte; } @@ -235,6 +249,7 @@ public class FormatTest { * @return date **/ @ApiModelProperty(required = true, value = "") + @NotNull public LocalDate getDate() { return date; } @@ -261,7 +276,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -271,11 +286,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -289,6 +304,8 @@ public class FormatTest { * @return password **/ @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/HasOnlyReadOnly.java index df5c0624a4c..a26492e4912 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java index 9ef30a045d0..9a0566a8dd1 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MapTest.java @@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.validation.constraints.*; /** * MapTest */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index ea443a94338..31f364f2497 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -10,14 +10,15 @@ import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; - +import java.util.UUID; +import javax.validation.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private OffsetDateTime dateTime = null; @@ -25,7 +26,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -35,11 +36,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Model200Response.java index 09ad4d0d60e..4d47f6c03c9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Model200Response.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelApiResponse.java index 82f447004ee..36da9b20d9d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelApiResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelReturn.java index 884a45c598e..7ffc24a0144 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ModelReturn.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Name.java index 88526226b78..953199166ff 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Name.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model name same as property name */ @@ -34,6 +34,7 @@ public class Name { * @return name **/ @ApiModelProperty(required = true, value = "") + @NotNull public Integer getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/NumberOnly.java index 9424f7a4b5e..e6dbf3139e2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/NumberOnly.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - +import javax.validation.constraints.*; /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Order.java index cee3ae6d708..d65ed713151 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Order.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; - +import javax.validation.constraints.*; /** * Order */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/OuterEnum.java index 0abc3d063b5..5f0075e4457 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/OuterEnum.java @@ -2,7 +2,7 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; - +import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java index 823d25e05a0..9adc708de71 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Pet.java @@ -10,7 +10,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * Pet */ @@ -113,6 +113,7 @@ public class Pet { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull public String getName() { return name; } @@ -136,6 +137,7 @@ public class Pet { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @NotNull public List getPhotoUrls() { return photoUrls; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ReadOnlyFirst.java index 217cc653189..47700659fd2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/SpecialModelName.java index 2cdc99de90e..880d70599b0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/SpecialModelName.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Tag.java index 846812a5031..298085317a4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/Tag.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Tag */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/User.java index 52c5fff826e..8e40f7e0594 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/io/swagger/model/User.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * User */ diff --git a/samples/server/petstore/springboot-delegate/pom.xml b/samples/server/petstore/springboot-delegate/pom.xml index fdb0b535b34..d777f7d31f1 100644 --- a/samples/server/petstore/springboot-delegate/pom.xml +++ b/samples/server/petstore/springboot-delegate/pom.xml @@ -62,5 +62,12 @@ joda-time joda-time + + + javax.validation + validation-api + 1.1.0.Final + provided + \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java index 7a9f9fc2920..74fb7693d7a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApi.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "fake", description = "the fake API") public interface FakeApi { @@ -70,9 +70,9 @@ public interface FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java index cee03f014a1..b6b0b70ba51 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/FakeApiController.java @@ -19,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class FakeApiController implements FakeApi { @@ -58,9 +58,9 @@ public class FakeApiController implements FakeApi { @ApiParam(value = "Form parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestPart(value="enumFormString", required=false) String enumFormString, @ApiParam(value = "Header parameter enum test (string array)" , allowableValues="GREATER_THAN, DOLLAR") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray, @ApiParam(value = "Header parameter enum test (string)" , allowableValues="_ABC, _EFG, _XYZ_", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString, - @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, - @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, - @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = "GREATER_THAN, DOLLAR") @RequestParam(value = "enumQueryStringArray", required = false) List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_ABC, _EFG, _XYZ_", defaultValue = "-efg") @RequestParam(value = "enumQueryString", required = false, defaultValue="-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)") @RequestParam(value = "enumQueryInteger", required = false) Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)" ) @RequestPart(value="enumQueryDouble", required=false) Double enumQueryDouble) { // do some magic! return delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java index 7d48cfb31c9..dcd4a0f8b8c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApi.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "pet", description = "the pet API") public interface PetApi { @@ -63,7 +63,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByStatus", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -78,7 +78,7 @@ public interface PetApi { @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java index 6eb175b89f0..03c23df7b47 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/PetApiController.java @@ -18,7 +18,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class PetApiController implements PetApi { @@ -41,12 +41,12 @@ public class PetApiController implements PetApi { return delegate.deletePet(petId, apiKey); } - public ResponseEntity> findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { + public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { // do some magic! return delegate.findPetsByStatus(status); } - public ResponseEntity> findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { // do some magic! return delegate.findPetsByTags(tags); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java index f5526de9862..47c2c561ff1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApi.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "store", description = "the store API") public interface StoreApi { @@ -49,7 +49,7 @@ public interface StoreApi { @RequestMapping(value = "/store/order/{orderId}", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java index 6215ded3540..050a9d7de74 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/StoreApiController.java @@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class StoreApiController implements StoreApi { @@ -39,7 +39,7 @@ public class StoreApiController implements StoreApi { return delegate.getInventory(); } - public ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { // do some magic! return delegate.getOrderById(orderId); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java index c31b5a143ee..2d15d4b071a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApi.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Api(value = "user", description = "the user API") public interface UserApi { @@ -75,8 +75,8 @@ public interface UserApi { @RequestMapping(value = "/user/login", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java index 7cb74a3e172..785e28f4509 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/api/UserApiController.java @@ -17,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; - +import javax.validation.constraints.*; @Controller public class UserApiController implements UserApi { @@ -54,8 +54,8 @@ public class UserApiController implements UserApi { return delegate.getUserByName(username); } - public ResponseEntity loginUser(@ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, - @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { + public ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return delegate.loginUser(username, password); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index f74f7d3d882..81535e041fa 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.validation.constraints.*; /** * AdditionalPropertiesClass */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Animal.java index 36c209fb93b..a218f0b5542 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Animal.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Animal */ @@ -34,6 +34,7 @@ public class Animal { * @return className **/ @ApiModelProperty(required = true, value = "") + @NotNull public String getClassName() { return className; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AnimalFarm.java index c2b0084d9cd..33dc04699af 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/AnimalFarm.java @@ -4,7 +4,7 @@ import java.util.Objects; import io.swagger.model.Animal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * AnimalFarm */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 803eb69e16a..3be691e4d95 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayOfArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index bebc2470927..12196897345 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayOfNumberOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java index 19464a99acd..a26a1600287 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ArrayTest.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.ReadOnlyFirst; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * ArrayTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Capitalization.java index 94cb9977104..d7ad5642ccf 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Capitalization.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Capitalization */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Cat.java index 95bea570923..747e5dc0c7e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Cat.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; - +import javax.validation.constraints.*; /** * Cat */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Category.java index ba1ecfdb2b8..9629da6500e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Category.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Category */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ClassModel.java index 16c743e4f32..d69acffefa8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ClassModel.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model with \"_class\" property */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Client.java index fcb2b0a8340..f9cec5a225e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Client.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Client */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Dog.java index f8072688756..9057e840fc3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Dog.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; - +import javax.validation.constraints.*; /** * Dog */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java index 959b35e6b13..97ab6f6410e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumArrays.java @@ -8,7 +8,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * EnumArrays */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumClass.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumClass.java index d8ac42c4872..cdfc0933c3e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumClass.java @@ -2,7 +2,7 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; - +import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumTest.java index d081e726855..9f2a0275a6a 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/EnumTest.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; - +import javax.validation.constraints.*; /** * EnumTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java index 6367fe81b0c..aed8db1ed96 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/FormatTest.java @@ -6,9 +6,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; - +import javax.validation.constraints.*; /** * FormatTest */ @@ -48,7 +49,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -65,6 +66,8 @@ public class FormatTest { * @return integer **/ @ApiModelProperty(value = "") + @Min(10) + @Max(100) public Integer getInteger() { return integer; } @@ -85,6 +88,8 @@ public class FormatTest { * @return int32 **/ @ApiModelProperty(value = "") + @Min(20) + @Max(200) public Integer getInt32() { return int32; } @@ -123,6 +128,9 @@ public class FormatTest { * @return number **/ @ApiModelProperty(required = true, value = "") + @NotNull + @DecimalMin("32.1") + @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -143,6 +151,8 @@ public class FormatTest { * @return _float **/ @ApiModelProperty(value = "") + @DecimalMin("54.3") + @DecimalMax("987.6") public Float getFloat() { return _float; } @@ -163,6 +173,8 @@ public class FormatTest { * @return _double **/ @ApiModelProperty(value = "") + @DecimalMin("67.8") + @DecimalMax("123.4") public Double getDouble() { return _double; } @@ -181,6 +193,7 @@ public class FormatTest { * @return string **/ @ApiModelProperty(value = "") + @Pattern(regexp="/[a-z]/i") public String getString() { return string; } @@ -199,6 +212,7 @@ public class FormatTest { * @return _byte **/ @ApiModelProperty(required = true, value = "") + @NotNull public byte[] getByte() { return _byte; } @@ -235,6 +249,7 @@ public class FormatTest { * @return date **/ @ApiModelProperty(required = true, value = "") + @NotNull public LocalDate getDate() { return date; } @@ -261,7 +276,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -271,11 +286,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } @@ -289,6 +304,8 @@ public class FormatTest { * @return password **/ @ApiModelProperty(required = true, value = "") + @NotNull + @Size(min=10,max=64) public String getPassword() { return password; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/HasOnlyReadOnly.java index df5c0624a4c..a26492e4912 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * HasOnlyReadOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java index 9ef30a045d0..9a0566a8dd1 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MapTest.java @@ -9,7 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.validation.constraints.*; /** * MapTest */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 36106536c7b..2cb9928d5fe 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -9,15 +9,16 @@ import io.swagger.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; - +import javax.validation.constraints.*; /** * MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -25,7 +26,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -35,11 +36,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Model200Response.java index 09ad4d0d60e..4d47f6c03c9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Model200Response.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model name starting with number */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelApiResponse.java index 82f447004ee..36da9b20d9d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelApiResponse.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * ModelApiResponse */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelReturn.java index 884a45c598e..7ffc24a0144 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ModelReturn.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing reserved words */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Name.java index 88526226b78..953199166ff 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Name.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Model for testing model name same as property name */ @@ -34,6 +34,7 @@ public class Name { * @return name **/ @ApiModelProperty(required = true, value = "") + @NotNull public Integer getName() { return name; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/NumberOnly.java index 9424f7a4b5e..e6dbf3139e2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/NumberOnly.java @@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; - +import javax.validation.constraints.*; /** * NumberOnly */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Order.java index 2863c127f60..41dec079587 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Order.java @@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime; - +import javax.validation.constraints.*; /** * Order */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/OuterEnum.java index 0abc3d063b5..5f0075e4457 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/OuterEnum.java @@ -2,7 +2,7 @@ package io.swagger.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; - +import javax.validation.constraints.*; import com.fasterxml.jackson.annotation.JsonCreator; /** diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java index 823d25e05a0..9adc708de71 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Pet.java @@ -10,7 +10,7 @@ import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; import java.util.List; - +import javax.validation.constraints.*; /** * Pet */ @@ -113,6 +113,7 @@ public class Pet { * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") + @NotNull public String getName() { return name; } @@ -136,6 +137,7 @@ public class Pet { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") + @NotNull public List getPhotoUrls() { return photoUrls; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ReadOnlyFirst.java index 217cc653189..47700659fd2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * ReadOnlyFirst */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/SpecialModelName.java index 2cdc99de90e..880d70599b0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/SpecialModelName.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * SpecialModelName */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Tag.java index 846812a5031..298085317a4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/Tag.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Tag */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/User.java index 52c5fff826e..8e40f7e0594 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/io/swagger/model/User.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * User */ diff --git a/samples/server/petstore/springboot/pom.xml b/samples/server/petstore/springboot/pom.xml index 9ba170a11a5..d777f7d31f1 100644 --- a/samples/server/petstore/springboot/pom.xml +++ b/samples/server/petstore/springboot/pom.xml @@ -1,9 +1,9 @@ 4.0.0 io.swagger - swagger-boot + swagger-spring jar - swagger-boot + swagger-spring 1.0.0 1.7 @@ -70,4 +70,4 @@ provided - + \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index a70f2a1a0db..dcd4a0f8b8c 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -1,6 +1,7 @@ package io.swagger.api; import java.io.File; +import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; import io.swagger.annotations.*; @@ -29,10 +30,10 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) @RequestMapping(value = "/pet", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, method = RequestMethod.POST) - ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body); + ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body); @ApiOperation(value = "Deletes a pet", notes = "", response = Void.class, authorizations = { @@ -44,7 +45,7 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) ResponseEntity deletePet(@ApiParam(value = "Pet id to delete",required=true ) @PathVariable("petId") Long petId, @ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey); @@ -60,9 +61,9 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid status value", response = Pet.class) }) @RequestMapping(value = "/pet/findByStatus", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter", allowableValues = "AVAILABLE, PENDING, SOLD", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List status); + ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status); @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { @@ -75,16 +76,12 @@ public interface PetApi { @ApiResponse(code = 200, message = "successful operation", response = Pet.class), @ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class) }) @RequestMapping(value = "/pet/findByTags", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags( @ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags); + ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags); - @ApiOperation(value = "Find pet by ID", notes = "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions", response = Pet.class, authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }), + @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { @Authorization(value = "api_key") }, tags={ "pet", }) @ApiResponses(value = { @@ -92,9 +89,9 @@ public interface PetApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Pet.class), @ApiResponse(code = 404, message = "Pet not found", response = Pet.class) }) @RequestMapping(value = "/pet/{petId}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId); + ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId); @ApiOperation(value = "Update an existing pet", notes = "", response = Void.class, authorizations = { @@ -108,10 +105,10 @@ public interface PetApi { @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) @RequestMapping(value = "/pet", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" }, method = RequestMethod.PUT) - ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body); + ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body); @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.class, authorizations = { @@ -123,27 +120,27 @@ public interface PetApi { @ApiResponses(value = { @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) @RequestMapping(value = "/pet/{petId}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, consumes = { "application/x-www-form-urlencoded" }, method = RequestMethod.POST) - ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId, + ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status); - @ApiOperation(value = "uploads an image", notes = "", response = Void.class, authorizations = { + @ApiOperation(value = "uploads an image", notes = "", response = ModelApiResponse.class, authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) + @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) @RequestMapping(value = "/pet/{petId}/uploadImage", - produces = { "application/json", "application/xml" }, + produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file); diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java index 2b18a2354d2..847b24e1a80 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java @@ -1,6 +1,7 @@ package io.swagger.api; import java.io.File; +import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; import io.swagger.annotations.*; @@ -24,7 +25,7 @@ public class PetApiController implements PetApi { - public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body) { + public ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -35,38 +36,38 @@ public class PetApiController implements PetApi { return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity> findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter", allowableValues = "AVAILABLE, PENDING, SOLD", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List status) { + public ResponseEntity> findPetsByStatus( @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "AVAILABLE, PENDING, SOLD") @RequestParam(value = "status", required = true) List status) { // do some magic! return new ResponseEntity>(HttpStatus.OK); } - public ResponseEntity> findPetsByTags( @ApiParam(value = "Tags to filter by") @RequestParam(value = "tags", required = false) List tags) { + public ResponseEntity> findPetsByTags( @NotNull @ApiParam(value = "Tags to filter by", required = true) @RequestParam(value = "tags", required = true) List tags) { // do some magic! return new ResponseEntity>(HttpStatus.OK); } - public ResponseEntity getPetById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("petId") Long petId) { + public ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true ) @PathVariable("petId") Long petId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ) @RequestBody Pet body) { + public ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @RequestBody Pet body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") String petId, + public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated",required=true ) @PathVariable("petId") Long petId, @ApiParam(value = "Updated name of the pet" ) @RequestPart(value="name", required=false) String name, @ApiParam(value = "Updated status of the pet" ) @RequestPart(value="status", required=false) String status) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true ) @PathVariable("petId") Long petId, @ApiParam(value = "Additional data to pass to server" ) @RequestPart(value="additionalMetadata", required=false) String additionalMetadata, @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file) { // do some magic! - return new ResponseEntity(HttpStatus.OK); + return new ResponseEntity(HttpStatus.OK); } } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index f4dd5a1be7e..47c2c561ff1 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -25,7 +25,7 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Order not found", response = Void.class) }) @RequestMapping(value = "/store/order/{orderId}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true ) @PathVariable("orderId") String orderId); @@ -36,7 +36,7 @@ public interface StoreApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Integer.class) }) @RequestMapping(value = "/store/inventory", - produces = { "application/json", "application/xml" }, + produces = { "application/json" }, method = RequestMethod.GET) ResponseEntity> getInventory(); @@ -47,9 +47,9 @@ public interface StoreApi { @ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), @ApiResponse(code = 404, message = "Order not found", response = Order.class) }) @RequestMapping(value = "/store/order/{orderId}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId); + ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId); @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) @@ -57,8 +57,8 @@ public interface StoreApi { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) @RequestMapping(value = "/store/order", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) @RequestBody Order body); + ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java index f08a84a1699..97a1b7e5129 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApiController.java @@ -34,12 +34,12 @@ public class StoreApiController implements StoreApi { return new ResponseEntity>(HttpStatus.OK); } - public ResponseEntity getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") String orderId) { + public ResponseEntity getOrderById( @Min(1) @Max(5)@ApiParam(value = "ID of pet that needs to be fetched",required=true ) @PathVariable("orderId") Long orderId) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ) @RequestBody Order body) { + public ResponseEntity placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @RequestBody Order body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index dbef9cd70d6..2d15d4b071a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -24,27 +24,27 @@ public interface UserApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @RequestMapping(value = "/user", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity createUser(@ApiParam(value = "Created user object" ) @RequestBody User body); + ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body); @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @RequestMapping(value = "/user/createWithArray", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ) @RequestBody List body); + ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body); @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @RequestMapping(value = "/user/createWithList", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.POST) - ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ) @RequestBody List body); + ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body); @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user", }) @@ -52,7 +52,7 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.DELETE) ResponseEntity deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true ) @PathVariable("username") String username); @@ -63,7 +63,7 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid username supplied", response = User.class), @ApiResponse(code = 404, message = "User not found", response = User.class) }) @RequestMapping(value = "/user/{username}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true ) @PathVariable("username") String username); @@ -73,17 +73,17 @@ public interface UserApi { @ApiResponse(code = 200, message = "successful operation", response = String.class), @ApiResponse(code = 400, message = "Invalid username/password supplied", response = String.class) }) @RequestMapping(value = "/user/login", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity loginUser( @ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username, - @ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password); + ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password); @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user", }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) @RequestMapping(value = "/user/logout", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.GET) ResponseEntity logoutUser(); @@ -93,9 +93,9 @@ public interface UserApi { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) @RequestMapping(value = "/user/{username}", - produces = { "application/json", "application/xml" }, + produces = { "application/xml", "application/json" }, method = RequestMethod.PUT) ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ) @RequestBody User body); + @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApiController.java index ff3559427f7..c321750e95e 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApiController.java @@ -24,17 +24,17 @@ public class UserApiController implements UserApi { - public ResponseEntity createUser(@ApiParam(value = "Created user object" ) @RequestBody User body) { + public ResponseEntity createUser(@ApiParam(value = "Created user object" ,required=true ) @RequestBody User body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ) @RequestBody List body) { + public ResponseEntity createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ) @RequestBody List body) { + public ResponseEntity createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @RequestBody List body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -49,8 +49,8 @@ public class UserApiController implements UserApi { return new ResponseEntity(HttpStatus.OK); } - public ResponseEntity loginUser( @ApiParam(value = "The user name for login") @RequestParam(value = "username", required = false) String username, - @ApiParam(value = "The password for login in clear text") @RequestParam(value = "password", required = false) String password) { + public ResponseEntity loginUser( @NotNull @ApiParam(value = "The user name for login", required = true) @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @RequestParam(value = "password", required = true) String password) { // do some magic! return new ResponseEntity(HttpStatus.OK); } @@ -61,7 +61,7 @@ public class UserApiController implements UserApi { } public ResponseEntity updateUser(@ApiParam(value = "name that need to be deleted",required=true ) @PathVariable("username") String username, - @ApiParam(value = "Updated user object" ) @RequestBody User body) { + @ApiParam(value = "Updated user object" ,required=true ) @RequestBody User body) { // do some magic! return new ResponseEntity(HttpStatus.OK); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java index 0652e2d736b..5658793e134 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -17,12 +17,12 @@ public class SwaggerDocumentationConfig { ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Swagger Petstore") - .description("This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters") + .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\") .license("Apache 2.0") .licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html") .termsOfServiceUrl("") .version("1.0.0") - .contact(new Contact("","", "apiteam@wordnik.com")) + .contact(new Contact("","", "apiteam@swagger.io")) .build(); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java index 94cb9977104..d7ad5642ccf 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java @@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - +import javax.validation.constraints.*; /** * Capitalization */ diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java index d48282d2d73..aed8db1ed96 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.UUID; import org.joda.time.DateTime; import org.joda.time.LocalDate; import javax.validation.constraints.*; @@ -48,7 +49,7 @@ public class FormatTest { private DateTime dateTime = null; @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("password") private String password = null; @@ -275,7 +276,7 @@ public class FormatTest { this.dateTime = dateTime; } - public FormatTest uuid(String uuid) { + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -285,11 +286,11 @@ public class FormatTest { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9ead927c389..2cb9928d5fe 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -9,6 +9,7 @@ import io.swagger.model.Animal; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import org.joda.time.DateTime; import javax.validation.constraints.*; /** @@ -17,7 +18,7 @@ import javax.validation.constraints.*; public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private String uuid = null; + private UUID uuid = null; @JsonProperty("dateTime") private DateTime dateTime = null; @@ -25,7 +26,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") private Map map = new HashMap(); - public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) { + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } @@ -35,11 +36,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { * @return uuid **/ @ApiModelProperty(value = "") - public String getUuid() { + public UUID getUuid() { return uuid; } - public void setUuid(String uuid) { + public void setUuid(UUID uuid) { this.uuid = uuid; } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java index a5833514b10..41dec079587 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java @@ -62,7 +62,7 @@ public class Order { private StatusEnum status = null; @JsonProperty("complete") - private Boolean complete = null; + private Boolean complete = false; public Order id(Long id) { this.id = id;