File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
validator-generator/src/main/java/io/avaje/validation/generator Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ public boolean isClassLvl() {
199199 return classLevel ;
200200 }
201201
202- public boolean hasAnnotations () {
202+ public boolean hasConstraints () {
203203 return !elementAnnotations .isEmpty ();
204204 }
205205}
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ void read(TypeElement type) {
5959 }
6060
6161 final var classAdapter = new FieldReader (type , genericTypeParams , true );
62- if (classAdapter .hasAnnotations ()) {
62+ if (classAdapter .hasConstraints ()) {
6363 localFields .add (classAdapter );
6464 }
6565
@@ -72,7 +72,10 @@ void read(TypeElement type) {
7272 private void readField (Element element , List <FieldReader > localFields ) {
7373 if (includeField (element )) {
7474 seenFields .add (element .toString ());
75- localFields .add (new FieldReader (element , genericTypeParams ));
75+ var reader = new FieldReader (element , genericTypeParams );
76+ if (reader .hasConstraints () || ValidPrism .isPresent (element )) {
77+ localFields .add (reader );
78+ }
7679 }
7780 }
7881
You can’t perform that action at this time.
0 commit comments