forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
commit
3ef7694b9f
@ -2,3 +2,4 @@
|
||||
@NotNull
|
||||
{{/required}}
|
||||
{{>beanValidationCore}}
|
||||
@Valid
|
||||
|
@ -7,8 +7,10 @@ import java.util.Objects;
|
||||
import java.io.Serializable;
|
||||
{{/serializableModel}}
|
||||
{{#useBeanValidation}}
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
{{/useBeanValidation}}
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
{{#isEnum}}
|
||||
|
@ -33,11 +33,15 @@ utility::string_t ApiClient::parameterToString(utility::string_t value)
|
||||
}
|
||||
utility::string_t ApiClient::parameterToString(int64_t value)
|
||||
{
|
||||
return utility::conversions::to_string_t(std::to_string(value));
|
||||
std::stringstream valueAsStringStream;
|
||||
valueAsStringStream << value;
|
||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||
}
|
||||
utility::string_t ApiClient::parameterToString(int32_t value)
|
||||
{
|
||||
return utility::conversions::to_string_t(std::to_string(value));
|
||||
std::stringstream valueAsStringStream;
|
||||
valueAsStringStream << value;
|
||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||
}
|
||||
|
||||
utility::string_t ApiClient::parameterToString(float value)
|
||||
|
@ -118,7 +118,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
|
||||
return content;
|
||||
}
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType )
|
||||
@ -127,7 +129,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream) ) ;
|
||||
return content;
|
||||
}
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType )
|
||||
@ -136,7 +140,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
|
||||
return content;
|
||||
}
|
||||
|
||||
|
@ -45,9 +45,18 @@ utility::string_t ApiClient::parameterToString(utility::string_t value)
|
||||
}
|
||||
utility::string_t ApiClient::parameterToString(int64_t value)
|
||||
{
|
||||
return utility::conversions::to_string_t(std::to_string(value));
|
||||
std::stringstream valueAsStringStream;
|
||||
valueAsStringStream << value;
|
||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||
}
|
||||
utility::string_t ApiClient::parameterToString(int32_t value)
|
||||
{
|
||||
std::stringstream valueAsStringStream;
|
||||
valueAsStringStream << value;
|
||||
return utility::conversions::to_string_t(valueAsStringStream.str());
|
||||
}
|
||||
|
||||
utility::string_t ApiClient::parameterToString(float value)
|
||||
{
|
||||
return utility::conversions::to_string_t(std::to_string(value));
|
||||
}
|
||||
@ -119,6 +128,17 @@ pplx::task<web::http::http_response> ApiClient::callApi(
|
||||
request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, contentType);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (contentType == U("application/json"))
|
||||
{
|
||||
web::json::value body_data = web::json::value::object();
|
||||
for (auto& kvp : formParams)
|
||||
{
|
||||
body_data[U(kvp.first)] = ModelBase::toJson(kvp.second);
|
||||
}
|
||||
request.set_body(body_data);
|
||||
}
|
||||
else
|
||||
{
|
||||
web::http::uri_builder formData;
|
||||
for (auto& kvp : formParams)
|
||||
@ -128,6 +148,7 @@ pplx::task<web::http::http_response> ApiClient::callApi(
|
||||
request.set_body(formData.query(), U("application/x-www-form-urlencoded"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
web::http::uri_builder builder(path);
|
||||
for (auto& kvp : queryParams)
|
||||
|
@ -50,6 +50,7 @@ public:
|
||||
static utility::string_t parameterToString(utility::string_t value);
|
||||
static utility::string_t parameterToString(int32_t value);
|
||||
static utility::string_t parameterToString(int64_t value);
|
||||
static utility::string_t parameterToString(float value);
|
||||
static utility::string_t parameterToString(const utility::datetime &value);
|
||||
|
||||
template<class T>
|
||||
|
@ -130,7 +130,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
|
||||
return content;
|
||||
}
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType )
|
||||
@ -139,7 +141,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream) ) ;
|
||||
return content;
|
||||
}
|
||||
std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType )
|
||||
@ -148,7 +152,9 @@ std::shared_ptr<HttpContent> ModelBase::toHttpContent( const utility::string_t&
|
||||
content->setName( name );
|
||||
content->setContentDisposition( U("form-data") );
|
||||
content->setContentType( contentType );
|
||||
content->setData( std::shared_ptr<std::istream>( new std::stringstream( std::to_string( value ) ) ) );
|
||||
std::stringstream* valueAsStringStream = new std::stringstream();
|
||||
(*valueAsStringStream) << value;
|
||||
content->setData( std::shared_ptr<std::istream>( valueAsStringStream ) );
|
||||
return content;
|
||||
}
|
||||
|
||||
@ -277,6 +283,10 @@ int32_t ModelBase::int32_tFromJson(web::json::value& val)
|
||||
{
|
||||
return val.as_integer();
|
||||
}
|
||||
float ModelBase::floatFromJson(web::json::value& val)
|
||||
{
|
||||
return val.as_double();
|
||||
}
|
||||
utility::string_t ModelBase::stringFromJson(web::json::value& val)
|
||||
{
|
||||
return val.is_string() ? val.as_string() : U("");
|
||||
@ -313,6 +323,15 @@ int32_t ModelBase::int32_tFromHttpContent(std::shared_ptr<HttpContent> val)
|
||||
ss >> result;
|
||||
return result;
|
||||
}
|
||||
float ModelBase::floatFromHttpContent(std::shared_ptr<HttpContent> val)
|
||||
{
|
||||
utility::string_t str = ModelBase::stringFromHttpContent(val);
|
||||
|
||||
utility::stringstream_t ss(str);
|
||||
float result = 0;
|
||||
ss >> result;
|
||||
return result;
|
||||
}
|
||||
utility::string_t ModelBase::stringFromHttpContent(std::shared_ptr<HttpContent> val)
|
||||
{
|
||||
std::shared_ptr<std::istream> data = val->getData();
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
|
||||
static int64_t int64_tFromJson(web::json::value& val);
|
||||
static int32_t int32_tFromJson(web::json::value& val);
|
||||
static float floatFromJson(web::json::value& val);
|
||||
static utility::string_t stringFromJson(web::json::value& val);
|
||||
static utility::datetime dateFromJson(web::json::value& val);
|
||||
static double doubleFromJson(web::json::value& val);
|
||||
@ -72,6 +73,7 @@ public:
|
||||
|
||||
static int64_t int64_tFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static int32_t int32_tFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static float floatFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static utility::string_t stringFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static utility::datetime dateFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
static bool boolFromHttpContent(std::shared_ptr<HttpContent> val);
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A category for a pet
|
||||
*/
|
||||
@ -28,6 +30,8 @@ public class Category {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -46,6 +50,8 @@ public class Category {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
*/
|
||||
@ -31,6 +33,8 @@ public class ModelApiResponse {
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -49,6 +53,8 @@ public class ModelApiResponse {
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -67,6 +73,8 @@ public class ModelApiResponse {
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
*/
|
||||
@ -75,6 +77,8 @@ public class Order {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -93,6 +97,8 @@ public class Order {
|
||||
* @return petId
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -111,6 +117,8 @@ public class Order {
|
||||
* @return quantity
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -129,6 +137,8 @@ public class Order {
|
||||
* @return shipDate
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -147,6 +157,8 @@ public class Order {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -165,6 +177,8 @@ public class Order {
|
||||
* @return complete
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -10,7 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
*/
|
||||
@ -78,6 +80,8 @@ public class Pet {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -96,6 +100,8 @@ public class Pet {
|
||||
* @return category
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -115,6 +121,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -139,6 +147,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -165,6 +175,8 @@ public class Pet {
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -183,6 +195,8 @@ public class Pet {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A tag for a pet
|
||||
*/
|
||||
@ -28,6 +30,8 @@ public class Tag {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -46,6 +50,8 @@ public class Tag {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
*/
|
||||
@ -46,6 +48,8 @@ public class User {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -64,6 +68,8 @@ public class User {
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -82,6 +88,8 @@ public class User {
|
||||
* @return firstName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -100,6 +108,8 @@ public class User {
|
||||
* @return lastName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -118,6 +128,8 @@ public class User {
|
||||
* @return email
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -136,6 +148,8 @@ public class User {
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -154,6 +168,8 @@ public class User {
|
||||
* @return phone
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -172,6 +188,8 @@ public class User {
|
||||
* @return userStatus
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A category for a pet
|
||||
*/
|
||||
@ -28,6 +30,8 @@ public class Category {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -46,6 +50,8 @@ public class Category {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
*/
|
||||
@ -31,6 +33,8 @@ public class ModelApiResponse {
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -49,6 +53,8 @@ public class ModelApiResponse {
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -67,6 +73,8 @@ public class ModelApiResponse {
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
*/
|
||||
@ -75,6 +77,8 @@ public class Order {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -93,6 +97,8 @@ public class Order {
|
||||
* @return petId
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -111,6 +117,8 @@ public class Order {
|
||||
* @return quantity
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -129,6 +137,8 @@ public class Order {
|
||||
* @return shipDate
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -147,6 +157,8 @@ public class Order {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -165,6 +177,8 @@ public class Order {
|
||||
* @return complete
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -10,7 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
*/
|
||||
@ -78,6 +80,8 @@ public class Pet {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -96,6 +100,8 @@ public class Pet {
|
||||
* @return category
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -115,6 +121,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -139,6 +147,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -165,6 +175,8 @@ public class Pet {
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -183,6 +195,8 @@ public class Pet {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A tag for a pet
|
||||
*/
|
||||
@ -28,6 +30,8 @@ public class Tag {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -46,6 +50,8 @@ public class Tag {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
*/
|
||||
@ -46,6 +48,8 @@ public class User {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -64,6 +68,8 @@ public class User {
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -82,6 +88,8 @@ public class User {
|
||||
* @return firstName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -100,6 +108,8 @@ public class User {
|
||||
* @return lastName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -118,6 +128,8 @@ public class User {
|
||||
* @return email
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -136,6 +148,8 @@ public class User {
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -154,6 +168,8 @@ public class User {
|
||||
* @return phone
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -172,6 +188,8 @@ public class User {
|
||||
* @return userStatus
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@ -38,6 +40,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
@ -64,6 +68,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class Animal {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
@ -53,6 +57,8 @@ public class Animal {
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ import java.util.Objects;
|
||||
import io.swagger.model.Animal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AnimalFarm
|
||||
*/
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
* @return arrayArrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class ArrayOfNumberOnly {
|
||||
* @return arrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.ReadOnlyFirst;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
@ -41,6 +43,8 @@ public class ArrayTest {
|
||||
* @return arrayOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
@ -67,6 +71,8 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
@ -93,6 +99,8 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfModel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
*/
|
||||
@ -39,6 +41,8 @@ public class Capitalization {
|
||||
* @return smallCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
@ -57,6 +61,8 @@ public class Capitalization {
|
||||
* @return capitalCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
@ -75,6 +81,8 @@ public class Capitalization {
|
||||
* @return smallSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
@ -93,6 +101,8 @@ public class Capitalization {
|
||||
* @return capitalSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
@ -111,6 +121,8 @@ public class Capitalization {
|
||||
* @return scAETHFlowPoints
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
@ -129,6 +141,8 @@ public class Capitalization {
|
||||
* @return ATT_NAME
|
||||
**/
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
|
||||
@Valid
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class Cat extends Animal {
|
||||
* @return declawed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class Category {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class Category {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class ClassModel {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
@ -24,6 +26,8 @@ public class Client {
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class Dog extends Animal {
|
||||
* @return breed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
@ -92,6 +94,8 @@ public class EnumArrays {
|
||||
* @return justSymbol
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
@ -118,6 +122,8 @@ public class EnumArrays {
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.OuterEnum;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumTest
|
||||
*/
|
||||
@ -130,6 +132,8 @@ public class EnumTest {
|
||||
* @return enumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
@ -148,6 +152,8 @@ public class EnumTest {
|
||||
* @return enumInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
@ -166,6 +172,8 @@ public class EnumTest {
|
||||
* @return enumNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
@ -184,6 +192,8 @@ public class EnumTest {
|
||||
* @return outerEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* FormatTest
|
||||
*/
|
||||
@ -66,7 +68,9 @@ public class FormatTest {
|
||||
* @return integer
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Min(10) @Max(100) public Integer getInteger() {
|
||||
@Min(10) @Max(100)
|
||||
@Valid
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
@ -86,7 +90,9 @@ public class FormatTest {
|
||||
* @return int32
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Min(20) @Max(200) public Integer getInt32() {
|
||||
@Min(20) @Max(200)
|
||||
@Valid
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
@ -104,6 +110,8 @@ public class FormatTest {
|
||||
* @return int64
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
@ -125,7 +133,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
@Valid
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
@ -145,7 +155,9 @@ public class FormatTest {
|
||||
* @return _float
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
|
||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||
@Valid
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
@ -165,7 +177,9 @@ public class FormatTest {
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
|
||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||
@Valid
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
@ -183,7 +197,9 @@ public class FormatTest {
|
||||
* @return string
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Pattern(regexp="/[a-z]/i") public String getString() {
|
||||
@Pattern(regexp="/[a-z]/i")
|
||||
@Valid
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
@ -202,6 +218,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
@ -220,6 +238,8 @@ public class FormatTest {
|
||||
* @return binary
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public byte[] getBinary() {
|
||||
return binary;
|
||||
}
|
||||
@ -239,6 +259,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
@ -257,6 +279,8 @@ public class FormatTest {
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -275,6 +299,8 @@ public class FormatTest {
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -294,7 +320,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@Size(min=10,max=64) public String getPassword() {
|
||||
@Size(min=10,max=64)
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* HasOnlyReadOnly
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class HasOnlyReadOnly {
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class HasOnlyReadOnly {
|
||||
* @return foo
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* MapTest
|
||||
*/
|
||||
@ -70,6 +72,8 @@ public class MapTest {
|
||||
* @return mapMapOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
@ -96,6 +100,8 @@ public class MapTest {
|
||||
* @return mapOfEnumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
@ -36,6 +38,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -54,6 +58,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -80,6 +86,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return map
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
*/
|
||||
@ -28,6 +30,8 @@ public class Model200Response {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -46,6 +50,8 @@ public class Model200Response {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ModelApiResponse
|
||||
*/
|
||||
@ -30,6 +32,8 @@ public class ModelApiResponse {
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -48,6 +52,8 @@ public class ModelApiResponse {
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -66,6 +72,8 @@ public class ModelApiResponse {
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class ModelReturn {
|
||||
* @return _return
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -53,6 +57,8 @@ public class Name {
|
||||
* @return snakeCase
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
@ -71,6 +77,8 @@ public class Name {
|
||||
* @return property
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
@ -89,6 +97,8 @@ public class Name {
|
||||
* @return _123Number
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public Integer get123Number() {
|
||||
return _123Number;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* NumberOnly
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class NumberOnly {
|
||||
* @return justNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
@ -74,6 +76,8 @@ public class Order {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -92,6 +96,8 @@ public class Order {
|
||||
* @return petId
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -110,6 +116,8 @@ public class Order {
|
||||
* @return quantity
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -128,6 +136,8 @@ public class Order {
|
||||
* @return shipDate
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -146,6 +156,8 @@ public class Order {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -164,6 +176,8 @@ public class Order {
|
||||
* @return complete
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Pet
|
||||
*/
|
||||
@ -77,6 +79,8 @@ public class Pet {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -95,6 +99,8 @@ public class Pet {
|
||||
* @return category
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -114,6 +120,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -138,6 +146,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -164,6 +174,8 @@ public class Pet {
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -182,6 +194,8 @@ public class Pet {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ReadOnlyFirst
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class ReadOnlyFirst {
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class ReadOnlyFirst {
|
||||
* @return baz
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* SpecialModelName
|
||||
*/
|
||||
@ -24,6 +26,8 @@ public class SpecialModelName {
|
||||
* @return specialPropertyName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class Tag {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class Tag {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* User
|
||||
*/
|
||||
@ -45,6 +47,8 @@ public class User {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -63,6 +67,8 @@ public class User {
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -81,6 +87,8 @@ public class User {
|
||||
* @return firstName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -99,6 +107,8 @@ public class User {
|
||||
* @return lastName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -117,6 +127,8 @@ public class User {
|
||||
* @return email
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -135,6 +147,8 @@ public class User {
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -153,6 +167,8 @@ public class User {
|
||||
* @return phone
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -171,6 +187,8 @@ public class User {
|
||||
* @return userStatus
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@ -38,6 +40,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
@ -64,6 +68,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class Animal {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
@ -53,6 +57,8 @@ public class Animal {
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ import java.util.Objects;
|
||||
import io.swagger.model.Animal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AnimalFarm
|
||||
*/
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
* @return arrayArrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class ArrayOfNumberOnly {
|
||||
* @return arrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.ReadOnlyFirst;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
@ -41,6 +43,8 @@ public class ArrayTest {
|
||||
* @return arrayOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
@ -67,6 +71,8 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
@ -93,6 +99,8 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfModel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
*/
|
||||
@ -39,6 +41,8 @@ public class Capitalization {
|
||||
* @return smallCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
@ -57,6 +61,8 @@ public class Capitalization {
|
||||
* @return capitalCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
@ -75,6 +81,8 @@ public class Capitalization {
|
||||
* @return smallSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
@ -93,6 +101,8 @@ public class Capitalization {
|
||||
* @return capitalSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
@ -111,6 +121,8 @@ public class Capitalization {
|
||||
* @return scAETHFlowPoints
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
@ -129,6 +141,8 @@ public class Capitalization {
|
||||
* @return ATT_NAME
|
||||
**/
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
|
||||
@Valid
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class Cat extends Animal {
|
||||
* @return declawed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class Category {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class Category {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class ClassModel {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
@ -24,6 +26,8 @@ public class Client {
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class Dog extends Animal {
|
||||
* @return breed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
@ -92,6 +94,8 @@ public class EnumArrays {
|
||||
* @return justSymbol
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
@ -118,6 +122,8 @@ public class EnumArrays {
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.OuterEnum;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumTest
|
||||
*/
|
||||
@ -130,6 +132,8 @@ public class EnumTest {
|
||||
* @return enumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
@ -148,6 +152,8 @@ public class EnumTest {
|
||||
* @return enumInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
@ -166,6 +172,8 @@ public class EnumTest {
|
||||
* @return enumNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
@ -184,6 +192,8 @@ public class EnumTest {
|
||||
* @return outerEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ import java.math.BigDecimal;
|
||||
import java.util.UUID;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* FormatTest
|
||||
*/
|
||||
@ -66,7 +68,9 @@ public class FormatTest {
|
||||
* @return integer
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Min(10) @Max(100) public Integer getInteger() {
|
||||
@Min(10) @Max(100)
|
||||
@Valid
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
@ -86,7 +90,9 @@ public class FormatTest {
|
||||
* @return int32
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Min(20) @Max(200) public Integer getInt32() {
|
||||
@Min(20) @Max(200)
|
||||
@Valid
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
@ -104,6 +110,8 @@ public class FormatTest {
|
||||
* @return int64
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
@ -125,7 +133,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
|
||||
@DecimalMin("32.1") @DecimalMax("543.2")
|
||||
@Valid
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
@ -145,7 +155,9 @@ public class FormatTest {
|
||||
* @return _float
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
|
||||
@DecimalMin("54.3") @DecimalMax("987.6")
|
||||
@Valid
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
@ -165,7 +177,9 @@ public class FormatTest {
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
|
||||
@DecimalMin("67.8") @DecimalMax("123.4")
|
||||
@Valid
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
@ -183,7 +197,9 @@ public class FormatTest {
|
||||
* @return string
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@Pattern(regexp="/[a-z]/i") public String getString() {
|
||||
@Pattern(regexp="/[a-z]/i")
|
||||
@Valid
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
@ -202,6 +218,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
@ -220,6 +238,8 @@ public class FormatTest {
|
||||
* @return binary
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public byte[] getBinary() {
|
||||
return binary;
|
||||
}
|
||||
@ -239,6 +259,8 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
@ -257,6 +279,8 @@ public class FormatTest {
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -275,6 +299,8 @@ public class FormatTest {
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -294,7 +320,9 @@ public class FormatTest {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
@Size(min=10,max=64) public String getPassword() {
|
||||
@Size(min=10,max=64)
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* HasOnlyReadOnly
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class HasOnlyReadOnly {
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class HasOnlyReadOnly {
|
||||
* @return foo
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
@ -9,7 +9,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* MapTest
|
||||
*/
|
||||
@ -70,6 +72,8 @@ public class MapTest {
|
||||
* @return mapMapOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
@ -96,6 +100,8 @@ public class MapTest {
|
||||
* @return mapOfEnumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
@ -11,7 +11,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
@ -36,6 +38,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
@ -54,6 +58,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
@ -80,6 +86,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
* @return map
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
*/
|
||||
@ -28,6 +30,8 @@ public class Model200Response {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -46,6 +50,8 @@ public class Model200Response {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ModelApiResponse
|
||||
*/
|
||||
@ -30,6 +32,8 @@ public class ModelApiResponse {
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@ -48,6 +52,8 @@ public class ModelApiResponse {
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@ -66,6 +72,8 @@ public class ModelApiResponse {
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class ModelReturn {
|
||||
* @return _return
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class Name {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
@ -53,6 +57,8 @@ public class Name {
|
||||
* @return snakeCase
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
@ -71,6 +77,8 @@ public class Name {
|
||||
* @return property
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
@ -89,6 +97,8 @@ public class Name {
|
||||
* @return _123Number
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public Integer get123Number() {
|
||||
return _123Number;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* NumberOnly
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class NumberOnly {
|
||||
* @return justNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
@ -74,6 +76,8 @@ public class Order {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -92,6 +96,8 @@ public class Order {
|
||||
* @return petId
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@ -110,6 +116,8 @@ public class Order {
|
||||
* @return quantity
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@ -128,6 +136,8 @@ public class Order {
|
||||
* @return shipDate
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@ -146,6 +156,8 @@ public class Order {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@ -164,6 +176,8 @@ public class Order {
|
||||
* @return complete
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
@ -10,7 +10,9 @@ import io.swagger.model.Category;
|
||||
import io.swagger.model.Tag;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Pet
|
||||
*/
|
||||
@ -77,6 +79,8 @@ public class Pet {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -95,6 +99,8 @@ public class Pet {
|
||||
* @return category
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@ -114,6 +120,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@ -138,6 +146,8 @@ public class Pet {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@ -164,6 +174,8 @@ public class Pet {
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
@ -182,6 +194,8 @@ public class Pet {
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
|
||||
@Valid
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ReadOnlyFirst
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class ReadOnlyFirst {
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(readOnly = true, value = "")
|
||||
|
||||
@Valid
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class ReadOnlyFirst {
|
||||
* @return baz
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* SpecialModelName
|
||||
*/
|
||||
@ -24,6 +26,8 @@ public class SpecialModelName {
|
||||
* @return specialPropertyName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class Tag {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class Tag {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* User
|
||||
*/
|
||||
@ -45,6 +47,8 @@ public class User {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -63,6 +67,8 @@ public class User {
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@ -81,6 +87,8 @@ public class User {
|
||||
* @return firstName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@ -99,6 +107,8 @@ public class User {
|
||||
* @return lastName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@ -117,6 +127,8 @@ public class User {
|
||||
* @return email
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@ -135,6 +147,8 @@ public class User {
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@ -153,6 +167,8 @@ public class User {
|
||||
* @return phone
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@ -171,6 +187,8 @@ public class User {
|
||||
* @return userStatus
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
|
||||
@Valid
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Api(value = "fake_classname_test", description = "the fake_classname_test API")
|
||||
public interface FakeClassnameTestApi {
|
||||
|
||||
@ApiOperation(value = "To test class name in snake case", notes = "", response = Client.class, tags={ "fake_classname_tags 123#$%^", })
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
@RequestMapping(value = "/fake_classname_test",
|
||||
produces = { "application/json" },
|
||||
consumes = { "application/json" },
|
||||
method = RequestMethod.PATCH)
|
||||
ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body, @RequestHeader("Accept") String accept) throws IOException;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Controller
|
||||
public class FakeClassnameTestApiController implements FakeClassnameTestApi {
|
||||
public ResponseEntity<Client> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body,
|
||||
@RequestHeader("Accept") String accept) throws IOException {
|
||||
// do some magic!
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return new ResponseEntity<Client>(objectMapper.readValue("{ \"client\" : \"aeiou\"}", Client.class), HttpStatus.OK);
|
||||
}
|
||||
|
||||
return new ResponseEntity<Client>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,232 @@
|
||||
package io.swagger.configuration;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonTokenId;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
|
||||
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
|
||||
import org.threeten.bp.DateTimeException;
|
||||
import org.threeten.bp.Instant;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.threeten.bp.ZoneId;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
import org.threeten.bp.format.DateTimeFormatter;
|
||||
import org.threeten.bp.temporal.Temporal;
|
||||
import org.threeten.bp.temporal.TemporalAccessor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s.
|
||||
* Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format.
|
||||
*
|
||||
* @author Nick Williams
|
||||
*/
|
||||
public class CustomInstantDeserializer<T extends Temporal>
|
||||
extends ThreeTenDateTimeDeserializerBase<T> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
|
||||
Instant.class, DateTimeFormatter.ISO_INSTANT,
|
||||
new Function<TemporalAccessor, Instant>() {
|
||||
@Override
|
||||
public Instant apply(TemporalAccessor temporalAccessor) {
|
||||
return Instant.from(temporalAccessor);
|
||||
}
|
||||
},
|
||||
new Function<FromIntegerArguments, Instant>() {
|
||||
@Override
|
||||
public Instant apply(FromIntegerArguments a) {
|
||||
return Instant.ofEpochMilli(a.value);
|
||||
}
|
||||
},
|
||||
new Function<FromDecimalArguments, Instant>() {
|
||||
@Override
|
||||
public Instant apply(FromDecimalArguments a) {
|
||||
return Instant.ofEpochSecond(a.integer, a.fraction);
|
||||
}
|
||||
},
|
||||
null
|
||||
);
|
||||
|
||||
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
|
||||
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
|
||||
new Function<TemporalAccessor, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
|
||||
return OffsetDateTime.from(temporalAccessor);
|
||||
}
|
||||
},
|
||||
new Function<FromIntegerArguments, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(FromIntegerArguments a) {
|
||||
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
|
||||
}
|
||||
},
|
||||
new Function<FromDecimalArguments, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(FromDecimalArguments a) {
|
||||
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
|
||||
}
|
||||
},
|
||||
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
|
||||
@Override
|
||||
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
|
||||
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
|
||||
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
|
||||
new Function<TemporalAccessor, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
|
||||
return ZonedDateTime.from(temporalAccessor);
|
||||
}
|
||||
},
|
||||
new Function<FromIntegerArguments, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(FromIntegerArguments a) {
|
||||
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
|
||||
}
|
||||
},
|
||||
new Function<FromDecimalArguments, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(FromDecimalArguments a) {
|
||||
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
|
||||
}
|
||||
},
|
||||
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
|
||||
@Override
|
||||
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
|
||||
return zonedDateTime.withZoneSameInstant(zoneId);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
protected final Function<FromIntegerArguments, T> fromMilliseconds;
|
||||
|
||||
protected final Function<FromDecimalArguments, T> fromNanoseconds;
|
||||
|
||||
protected final Function<TemporalAccessor, T> parsedToValue;
|
||||
|
||||
protected final BiFunction<T, ZoneId, T> adjust;
|
||||
|
||||
protected CustomInstantDeserializer(Class<T> supportedType,
|
||||
DateTimeFormatter parser,
|
||||
Function<TemporalAccessor, T> parsedToValue,
|
||||
Function<FromIntegerArguments, T> fromMilliseconds,
|
||||
Function<FromDecimalArguments, T> fromNanoseconds,
|
||||
BiFunction<T, ZoneId, T> adjust) {
|
||||
super(supportedType, parser);
|
||||
this.parsedToValue = parsedToValue;
|
||||
this.fromMilliseconds = fromMilliseconds;
|
||||
this.fromNanoseconds = fromNanoseconds;
|
||||
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
|
||||
@Override
|
||||
public T apply(T t, ZoneId zoneId) {
|
||||
return t;
|
||||
}
|
||||
} : adjust;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
|
||||
super((Class<T>) base.handledType(), f);
|
||||
parsedToValue = base.parsedToValue;
|
||||
fromMilliseconds = base.fromMilliseconds;
|
||||
fromNanoseconds = base.fromNanoseconds;
|
||||
adjust = base.adjust;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
|
||||
if (dtf == _formatter) {
|
||||
return this;
|
||||
}
|
||||
return new CustomInstantDeserializer<T>(this, dtf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
|
||||
//NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only
|
||||
//string values have to be adjusted to the configured TZ.
|
||||
switch (parser.getCurrentTokenId()) {
|
||||
case JsonTokenId.ID_NUMBER_FLOAT: {
|
||||
BigDecimal value = parser.getDecimalValue();
|
||||
long seconds = value.longValue();
|
||||
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
|
||||
return fromNanoseconds.apply(new FromDecimalArguments(
|
||||
seconds, nanoseconds, getZone(context)));
|
||||
}
|
||||
|
||||
case JsonTokenId.ID_NUMBER_INT: {
|
||||
long timestamp = parser.getLongValue();
|
||||
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
|
||||
return this.fromNanoseconds.apply(new FromDecimalArguments(
|
||||
timestamp, 0, this.getZone(context)
|
||||
));
|
||||
}
|
||||
return this.fromMilliseconds.apply(new FromIntegerArguments(
|
||||
timestamp, this.getZone(context)
|
||||
));
|
||||
}
|
||||
|
||||
case JsonTokenId.ID_STRING: {
|
||||
String string = parser.getText().trim();
|
||||
if (string.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
if (string.endsWith("+0000")) {
|
||||
string = string.substring(0, string.length() - 5) + "Z";
|
||||
}
|
||||
T value;
|
||||
try {
|
||||
TemporalAccessor acc = _formatter.parse(string);
|
||||
value = parsedToValue.apply(acc);
|
||||
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
|
||||
return adjust.apply(value, this.getZone(context));
|
||||
}
|
||||
} catch (DateTimeException e) {
|
||||
throw _peelDTE(e);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw context.mappingException("Expected type float, integer, or string.");
|
||||
}
|
||||
|
||||
private ZoneId getZone(DeserializationContext context) {
|
||||
// Instants are always in UTC, so don't waste compute cycles
|
||||
return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone());
|
||||
}
|
||||
|
||||
private static class FromIntegerArguments {
|
||||
public final long value;
|
||||
public final ZoneId zoneId;
|
||||
|
||||
private FromIntegerArguments(long value, ZoneId zoneId) {
|
||||
this.value = value;
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
}
|
||||
|
||||
private static class FromDecimalArguments {
|
||||
public final long integer;
|
||||
public final int fraction;
|
||||
public final ZoneId zoneId;
|
||||
|
||||
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
|
||||
this.integer = integer;
|
||||
this.fraction = fraction;
|
||||
this.zoneId = zoneId;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package io.swagger.configuration;
|
||||
|
||||
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.threeten.bp.Instant;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.threeten.bp.ZonedDateTime;
|
||||
|
||||
@Configuration
|
||||
public class JacksonConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(ThreeTenModule.class)
|
||||
ThreeTenModule threeTenModule() {
|
||||
ThreeTenModule module = new ThreeTenModule();
|
||||
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
|
||||
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
|
||||
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
|
||||
return module;
|
||||
}
|
||||
}
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@ -38,6 +40,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
@ -64,6 +68,8 @@ public class AdditionalPropertiesClass {
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class Animal {
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@NotNull
|
||||
|
||||
@Valid
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
@ -53,6 +57,8 @@ public class Animal {
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ import java.util.Objects;
|
||||
import io.swagger.model.Animal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* AnimalFarm
|
||||
*/
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
* @return arrayArrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
@ -35,6 +37,8 @@ public class ArrayOfNumberOnly {
|
||||
* @return arrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.ReadOnlyFirst;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
@ -41,6 +43,8 @@ public class ArrayTest {
|
||||
* @return arrayOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
@ -67,6 +71,8 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
@ -93,6 +99,8 @@ public class ArrayTest {
|
||||
* @return arrayArrayOfModel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
*/
|
||||
@ -39,6 +41,8 @@ public class Capitalization {
|
||||
* @return smallCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
@ -57,6 +61,8 @@ public class Capitalization {
|
||||
* @return capitalCamel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
@ -75,6 +81,8 @@ public class Capitalization {
|
||||
* @return smallSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
@ -93,6 +101,8 @@ public class Capitalization {
|
||||
* @return capitalSnake
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
@ -111,6 +121,8 @@ public class Capitalization {
|
||||
* @return scAETHFlowPoints
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
@ -129,6 +141,8 @@ public class Capitalization {
|
||||
* @return ATT_NAME
|
||||
**/
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
|
||||
@Valid
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class Cat extends Animal {
|
||||
* @return declawed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
@ -27,6 +29,8 @@ public class Category {
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@ -45,6 +49,8 @@ public class Category {
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class ClassModel {
|
||||
* @return propertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ 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.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
@ -24,6 +26,8 @@ public class Client {
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
@ -6,7 +6,9 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
@ -25,6 +27,8 @@ public class Dog extends Animal {
|
||||
* @return breed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
@ -92,6 +94,8 @@ public class EnumArrays {
|
||||
* @return justSymbol
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
@ -118,6 +122,8 @@ public class EnumArrays {
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
|
||||
/**
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user