forked from loafle/openapi-generator-original
@@ -1,53 +1,4 @@
|
|||||||
{{#required}}
|
{{#required}}
|
||||||
@NotNull
|
@NotNull
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{#pattern}}
|
{{>beanValidationCore}}
|
||||||
@Pattern(regexp="{{pattern}}")
|
|
||||||
{{/pattern}}
|
|
||||||
{{#minLength}}
|
|
||||||
{{#maxLength}}
|
|
||||||
@Size(min={{minLength}},max={{maxLength}})
|
|
||||||
{{/maxLength}}
|
|
||||||
{{/minLength}}
|
|
||||||
{{#minLength}}
|
|
||||||
{{^maxLength}}
|
|
||||||
@Size(min={{minLength}})
|
|
||||||
{{/maxLength}}
|
|
||||||
{{/minLength}}
|
|
||||||
{{^minLength}}
|
|
||||||
{{#maxLength}}
|
|
||||||
@Size(max={{maxLength}})
|
|
||||||
{{/maxLength}}
|
|
||||||
{{/minLength}}
|
|
||||||
{{#minItems}}
|
|
||||||
{{#maxItems}}
|
|
||||||
@Size(min={{minItems}},max={{maxItems}})
|
|
||||||
{{/maxItems}}
|
|
||||||
{{/minItems}}
|
|
||||||
{{#minItems}}
|
|
||||||
{{^maxItems}}
|
|
||||||
@Size(min={{minItems}})
|
|
||||||
{{/maxItems}}
|
|
||||||
{{/minItems}}
|
|
||||||
{{^minItems}}
|
|
||||||
{{#maxItems}}
|
|
||||||
@Size(max={{maxItems}})
|
|
||||||
{{/maxItems}}
|
|
||||||
{{/minItems}}
|
|
||||||
{{! check for integer / number=decimal type}}
|
|
||||||
{{#isInteger}}
|
|
||||||
{{#minimum}}
|
|
||||||
@Min({{minimum}})
|
|
||||||
{{/minimum}}
|
|
||||||
{{#maximum}}
|
|
||||||
@Max({{maximum}})
|
|
||||||
{{/maximum}}
|
|
||||||
{{/isInteger}}
|
|
||||||
{{^isInteger}}
|
|
||||||
{{#minimum}}
|
|
||||||
@DecimalMin("{{minimum}}")
|
|
||||||
{{/minimum}}
|
|
||||||
{{#maximum}}
|
|
||||||
@DecimalMax("{{maximum}}")
|
|
||||||
{{/maximum}}
|
|
||||||
{{/isInteger}}
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{!
|
||||||
|
minLength && maxLength set
|
||||||
|
}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{!
|
||||||
|
minLength set, maxLength not
|
||||||
|
}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{!
|
||||||
|
minLength not set, maxLength set
|
||||||
|
}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{!
|
||||||
|
@Size: minItems && maxItems set
|
||||||
|
}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{!
|
||||||
|
@Size: minItems set, maxItems not
|
||||||
|
}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{!
|
||||||
|
@Size: minItems not set && maxItems set
|
||||||
|
}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{!
|
||||||
|
check for integer or long / all others=decimal type with @Decimal*
|
||||||
|
isInteger set
|
||||||
|
}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{!
|
||||||
|
isLong set
|
||||||
|
}}{{#isLong}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isLong}}{{!
|
||||||
|
Not Integer, not Long => we have a decimal value!
|
||||||
|
}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}}
|
||||||
@@ -1 +1 @@
|
|||||||
{{! PathParam is always required, no @NotNull necessary }}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}
|
{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}}
|
||||||
@@ -1 +1 @@
|
|||||||
{{#required}} @NotNull{{/required}}{{#pattern}} @Pattern(regexp="{{pattern}}"){{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}
|
{{#required}} @NotNull{{/required}}{{>beanValidationCore}}
|
||||||
@@ -66,9 +66,7 @@ public class FormatTest {
|
|||||||
* @return integer
|
* @return integer
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@Min(10)
|
@Min(10) @Max(100) public Integer getInteger() {
|
||||||
@Max(100)
|
|
||||||
public Integer getInteger() {
|
|
||||||
return integer;
|
return integer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,9 +86,7 @@ public class FormatTest {
|
|||||||
* @return int32
|
* @return int32
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@Min(20)
|
@Min(20) @Max(200) public Integer getInt32() {
|
||||||
@Max(200)
|
|
||||||
public Integer getInt32() {
|
|
||||||
return int32;
|
return int32;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,9 +125,7 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
@DecimalMin("32.1")
|
@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
|
||||||
@DecimalMax("543.2")
|
|
||||||
public BigDecimal getNumber() {
|
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,9 +145,7 @@ public class FormatTest {
|
|||||||
* @return _float
|
* @return _float
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@DecimalMin("54.3")
|
@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
|
||||||
@DecimalMax("987.6")
|
|
||||||
public Float getFloat() {
|
|
||||||
return _float;
|
return _float;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,9 +165,7 @@ public class FormatTest {
|
|||||||
* @return _double
|
* @return _double
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@DecimalMin("67.8")
|
@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
|
||||||
@DecimalMax("123.4")
|
|
||||||
public Double getDouble() {
|
|
||||||
return _double;
|
return _double;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,8 +183,7 @@ public class FormatTest {
|
|||||||
* @return string
|
* @return string
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@Pattern(regexp="/[a-z]/i")
|
@Pattern(regexp="/[a-z]/i") public String getString() {
|
||||||
public String getString() {
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,8 +294,7 @@ public class FormatTest {
|
|||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@NotNull
|
@NotNull
|
||||||
@Size(min=10,max=64)
|
@Size(min=10,max=64) public String getPassword() {
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user