File tree Expand file tree Collapse file tree 4 files changed +24
-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 +24
-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 Ignore {}
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 (IgnorePrism .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 .Ignore .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 .Ignore ;
12
13
import io .avaje .http .api .QueryParam ;
13
14
import io .avaje .jsonb .Json ;
14
15
@@ -30,6 +31,12 @@ public class GetBeanForm {
30
31
31
32
@ QueryParam private Set <ServerType > type ;
32
33
34
+ @ Json .Ignore @ Ignore private String ignored ;
35
+
36
+ public String getIgnored () {
37
+ return ignored ;
38
+ }
39
+
33
40
public String getName () {
34
41
return name ;
35
42
}
You can’t perform that action at this time.
0 commit comments