File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
http-api/src/main/java/io/avaje/http/api
http-generator-core/src/main/java/io/avaje/http/generator/core
tests/test-javalin-jsonb/src/main/java/org/example/myapp/web Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ package io .avaje .http .api ;
2
+
3
+ import static java .lang .annotation .ElementType .FIELD ;
4
+ import static java .lang .annotation .RetentionPolicy .SOURCE ;
5
+
6
+ import java .lang .annotation .Retention ;
7
+ import java .lang .annotation .Target ;
8
+
9
+ /** Mark a field on a BeanParam/FormParam class as not a request parameter of any kind */
10
+ @ Target (FIELD )
11
+ @ Retention (SOURCE )
12
+ public @interface IgnoreBeanField {}
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ private void read() {
40
40
}
41
41
42
42
private void readField (Element enclosedElement ) {
43
+
44
+ if (IgnoreBeanFieldPrism .isPresent (enclosedElement )) {
45
+ return ;
46
+ }
43
47
FieldReader field = new FieldReader (enclosedElement , defaultParamType );
44
48
fieldMap .put (field .varName (), field );
45
49
}
Original file line number Diff line number Diff line change 1
1
/** Generate the prisms to access annotation info */
2
2
@ GeneratePrism (value = io .avaje .http .api .Controller .class , publicAccess = true )
3
3
@ GeneratePrism (value = io .avaje .http .api .BeanParam .class , publicAccess = true )
4
+ @ GeneratePrism (value = io .avaje .http .api .IgnoreBeanField .class , publicAccess = true )
4
5
@ GeneratePrism (value = io .avaje .http .api .QueryParam .class , publicAccess = true )
5
6
@ GeneratePrism (value = io .avaje .http .api .Client .class , publicAccess = true )
6
7
@ GeneratePrism (value = io .avaje .http .api .Cookie .class , publicAccess = true )
Original file line number Diff line number Diff line change 9
9
import javax .validation .constraints .Size ;
10
10
11
11
import io .avaje .http .api .Header ;
12
+ import io .avaje .http .api .IgnoreBeanField ;
12
13
import io .avaje .http .api .QueryParam ;
13
14
import io .avaje .jsonb .Json ;
15
+ import io .avaje .jsonb .Json .Ignore ;
14
16
15
17
@ Json
16
18
@ Valid
@@ -30,6 +32,12 @@ public class GetBeanForm {
30
32
31
33
@ QueryParam private Set <ServerType > type ;
32
34
35
+ @ Ignore @ IgnoreBeanField private String ignored ;
36
+
37
+ public String getIgnored () {
38
+ return ignored ;
39
+ }
40
+
33
41
public String getName () {
34
42
return name ;
35
43
}
You can’t perform that action at this time.
0 commit comments