forked from com2ghz/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jaxrs-reasteasy-eap] Fix invalid Bean Validation annotations for Lon…
…gs (OpenAPITools#5659) * fix issue OpenAPITools#5658 * update samples
- Loading branch information
1 parent
70ca591
commit 3e397f9
Showing
14 changed files
with
39 additions
and
68 deletions.
There are no files selected for viewing
51 changes: 1 addition & 50 deletions
51
modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/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,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}} |
20 changes: 20 additions & 0 deletions
20
...s/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.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}} @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}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! | ||
Not Integer, not Long => we have a decimal value! | ||
}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{maximum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/maximum}}{{/isLong}}{{/isInteger}} |
2 changes: 1 addition & 1 deletion
2
...i-generator/src/main/resources/JavaJaxRS/resteasy/eap/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}}{{#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}} |
2 changes: 1 addition & 1 deletion
2
...api-generator/src/main/resources/JavaJaxRS/resteasy/eap/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 }}{{#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}} |
2 changes: 1 addition & 1 deletion
2
...pi-generator/src/main/resources/JavaJaxRS/resteasy/eap/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}}{{#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}} |
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
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
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
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
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