-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[kotlin-server] fix bean validation site targets (#14997)
- Loading branch information
1 parent
1204662
commit 2250aae
Showing
8 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
7 changes: 3 additions & 4 deletions
7
...i-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidation.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
@Valid | ||
@field:Valid | ||
{{#required}} | ||
@NotNull | ||
{{/required}} | ||
{{>beanValidationCore}} | ||
@field:NotNull | ||
{{/required}} |
2 changes: 1 addition & 1 deletion
2
...src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationHeaderParams.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{#required}} @NotNull{{/required}}{{>beanValidationCore}} | ||
{{#required}} @NotNull{{/required}}{{>beanValidationPath}} |
20 changes: 20 additions & 0 deletions
20
...erator/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationModel.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{#pattern}} @field:Pattern(regexp="{{{.}}}"){{/pattern}}{{! | ||
minLength && maxLength set | ||
}}{{#minLength}}{{#maxLength}} @field:Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! | ||
minLength set, maxLength not | ||
}}{{#minLength}}{{^maxLength}} @field:Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! | ||
minLength not set, maxLength set | ||
}}{{^minLength}}{{#maxLength}} @field:Size(max={{.}}){{/maxLength}}{{/minLength}}{{! | ||
@Size: minItems && maxItems set | ||
}}{{#minItems}}{{#maxItems}} @field:Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! | ||
@Size: minItems set, maxItems not | ||
}}{{#minItems}}{{^maxItems}} @field:Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! | ||
@Size: minItems not set && maxItems set | ||
}}{{^minItems}}{{#maxItems}} @field:Size(max={{.}}){{/maxItems}}{{/minItems}}{{! | ||
check for integer or long / all others=decimal type with @Decimal* | ||
isInteger set | ||
}}{{#isInteger}}{{#minimum}} @field:Min({{.}}){{/minimum}}{{#maximum}} @field:Max({{.}}){{/maximum}}{{/isInteger}}{{! | ||
isLong set | ||
}}{{#isLong}}{{#minimum}} @field:Min({{.}}L){{/minimum}}{{#maximum}} @field:Max({{.}}L){{/maximum}}{{/isLong}}{{! | ||
Not Integer, not Long => we have a decimal value! | ||
}}{{^isInteger}}{{^isLong}}{{#minimum}} @field:DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @field:DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...r/src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationPathParams.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} | ||
{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationPath}} |
2 changes: 1 addition & 1 deletion
2
.../src/main/resources/kotlin-server/libraries/jaxrs-spec/beanValidationQueryParams.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{#required}} @NotNull{{/required}}{{>beanValidationCore}} | ||
{{#required}} @NotNull{{/required}}{{>beanValidationPath}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters