Skip to content

Commit 4647e42

Browse files
authored
Merge pull request #648 from Fyro-Ing/master
[JavaJaxRS] enhance beanvalidation by adding @Valid
2 parents 0918364 + 1e1914f commit 4647e42

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
{{#required}}
22
@NotNull
33
{{/required}}
4-
{{>beanValidationCore}}
4+
{{#is this 'container'}}
5+
{{#isNot this 'primitive-type'}}
6+
{{#isNot this 'enum'}}
7+
@Valid
8+
{{/isNot}}
9+
{{/isNot}}
10+
{{/is}}
11+
{{#isNot this 'container'}}
12+
{{#isNot this 'primitive-type'}}
13+
@Valid
14+
{{/isNot}}
15+
{{/isNot}}
16+
{{>beanValidationCore}}
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
{{#required}}
22
@NotNull
33
{{/required}}
4-
{{>beanValidationCore}}
4+
{{#isContainer}}
5+
{{^isPrimitiveType}}
6+
{{^isEnum}}
7+
@Valid
8+
{{/isEnum}}
9+
{{/isPrimitiveType}}
10+
{{/isContainer}}
11+
{{#isNotContainer}}
12+
{{^isPrimitiveType}}
13+
@Valid
14+
{{/isPrimitiveType}}
15+
{{/isNotContainer}}
16+
{{>beanValidationCore}}

src/main/resources/handlebars/JavaJaxRS/model.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import java.io.Serializable;
1616
{{/serializableModel}}
1717
{{#useBeanValidation}}
1818
import javax.validation.constraints.*;
19+
import javax.validation.Valid;
1920
{{/useBeanValidation}}
2021
{{/x-is-composed-model}}
2122

0 commit comments

Comments
 (0)