Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,53 +1,4 @@
{{#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}}
{{! 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}}
{{>beanValidationCore}}
Original file line number Diff line number Diff line change
@@ -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}}
Original file line number Diff line number Diff line change
@@ -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}}
Original file line number Diff line number Diff line change
@@ -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}}
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ public FormatTest integer(Integer integer) {
**/
@JsonProperty("integer")
@ApiModelProperty(value = "")
@Min(10)
@Max(100)
public Integer getInteger() {
@Min(10) @Max(100) public Integer getInteger() {
return integer;
}

Expand All @@ -102,9 +100,7 @@ public FormatTest int32(Integer int32) {
**/
@JsonProperty("int32")
@ApiModelProperty(value = "")
@Min(20)
@Max(200)
public Integer getInt32() {
@Min(20) @Max(200) public Integer getInt32() {
return int32;
}

Expand Down Expand Up @@ -145,9 +141,7 @@ public FormatTest number(BigDecimal number) {
@JsonProperty("number")
@ApiModelProperty(required = true, value = "")
@NotNull
@DecimalMin("32.1")
@DecimalMax("543.2")
public BigDecimal getNumber() {
@DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() {
return number;
}

Expand All @@ -168,9 +162,7 @@ public FormatTest _float(Float _float) {
**/
@JsonProperty("float")
@ApiModelProperty(value = "")
@DecimalMin("54.3")
@DecimalMax("987.6")
public Float getFloat() {
@DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() {
return _float;
}

Expand All @@ -191,9 +183,7 @@ public FormatTest _double(Double _double) {
**/
@JsonProperty("double")
@ApiModelProperty(value = "")
@DecimalMin("67.8")
@DecimalMax("123.4")
public Double getDouble() {
@DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() {
return _double;
}

Expand All @@ -212,8 +202,7 @@ public FormatTest string(String string) {
**/
@JsonProperty("string")
@ApiModelProperty(value = "")
@Pattern(regexp="/[a-z]/i")
public String getString() {
@Pattern(regexp="/[a-z]/i") public String getString() {
return string;
}

Expand Down Expand Up @@ -330,8 +319,7 @@ public FormatTest password(String password) {
@JsonProperty("password")
@ApiModelProperty(required = true, value = "")
@NotNull
@Size(min=10,max=64)
public String getPassword() {
@Size(min=10,max=64) public String getPassword() {
return password;
}

Expand Down