-
-
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.
Support
useBeanValidation
-configOption (#50)
* Support `useBeanValidation`-configOption in Record-fields * Update pom.xml * Update pojo.mustache * Annotate fields with bean validation * Update comment in `pojo.mustache` * Support `useBeanValidation`-configOption in Record-fields * Annotate fields with bean validation * Update comment in `pojo.mustache` * Add execution for `useBeanValidation` * Format `PluginExecution.java` * Annotate boolean-fields * Add new schema for testing string constraints * Support Nullable String-fields * Execute baseline tests of `RecordWithAllConstraints` * Add tests for `@NotNull`-annotations * Add inner `Builder`-class to `GenerateField` * Remove primitive-type check * Annotate fields with `@Pattern` * Add `@Size`-annotation based on `minLength`/`maxLength` * Annotate with `@Size` when `minItems`/`maxItems` is set * Annotate `Integer`-fields with `@Min`/`@Max` * Annotate `Long`-fields with `@Min`/`@Max` * Annotate `BigDecimal`-fields with `@DecimalMin`/`@DecimalMax` * Remove prototype `.mustache`-template * Update project version 1.7.6 -> 1.8.0 * Update project version 1.7.6 -> 1.8.0 * Reset minimum package line coverage ratio to 100%
- Loading branch information
Showing
79 changed files
with
2,200 additions
and
101 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{{! | ||
Source: openapi-to-java-records-mustache-templates | ||
Version: 1.8.0 | ||
Enabled via configOption.useBeanValidation=true | ||
}}{{#useBeanValidation}}{{! | ||
}}{{^required}}{{! | ||
When not required, the field *may* be nullable according to openapi-generator-maven-plugin. | ||
}}{{/required}}{{! | ||
}}{{#required}}{{! | ||
}}{{#isNullable}}{{! | ||
Jakarta Bean Validation does not have constraint annotations for nullable values, | ||
as values are nullable by default. | ||
}}{{/isNullable}}{{! | ||
}}{{^isNullable}}{{! | ||
}} @NotNull{{! | ||
}}{{/isNullable}}{{! | ||
}}{{/required}}{{! | ||
}}{{#pattern}}{{! | ||
}} @Pattern(regexp = "{{{.}}}"){{! | ||
}}{{/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}}{{! | ||
}}{{#isInteger}}{{! | ||
}}{{#minimum}}{{! | ||
}} @Min({{.}}){{! | ||
}}{{/minimum}}{{! | ||
}}{{#maximum}}{{! | ||
}} @Max({{.}}){{! | ||
}}{{/maximum}}{{! | ||
}}{{/isInteger}}{{! | ||
}}{{#isLong}}{{! | ||
}}{{#minimum}}{{! | ||
}} @Min({{.}}L){{! | ||
}}{{/minimum}}{{! | ||
}}{{#maximum}}{{! | ||
}} @Max({{.}}L){{! | ||
}}{{/maximum}}{{! | ||
}}{{/isLong}}{{! | ||
}}{{^isInteger}}{{! | ||
}}{{^isLong}}{{! | ||
}}{{#minimum}}{{! | ||
}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{! | ||
}}{{/minimum}}{{! | ||
}}{{#maximum}}{{! | ||
}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{! | ||
}}{{/maximum}}{{! | ||
}}{{/isLong}}{{! | ||
}}{{/isInteger}}{{! | ||
}}{{/useBeanValidation}} |
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
Oops, something went wrong.