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() {
4040 }
4141
4242 private void readField (Element enclosedElement ) {
43+
44+ if (IgnorePrism .isPresent (enclosedElement )) {
45+ return ;
46+ }
4347 FieldReader field = new FieldReader (enclosedElement , defaultParamType );
4448 fieldMap .put (field .varName (), field );
4549 }
Original file line number Diff line number Diff line change 11/** Generate the prisms to access annotation info */
22@ GeneratePrism (value = io .avaje .http .api .Controller .class , publicAccess = true )
33@ GeneratePrism (value = io .avaje .http .api .BeanParam .class , publicAccess = true )
4+ @ GeneratePrism (value = io .avaje .http .api .Ignore .class , publicAccess = true )
45@ GeneratePrism (value = io .avaje .http .api .QueryParam .class , publicAccess = true )
56@ GeneratePrism (value = io .avaje .http .api .Client .class , publicAccess = true )
67@ GeneratePrism (value = io .avaje .http .api .Cookie .class , publicAccess = true )
Original file line number Diff line number Diff line change 99import javax .validation .constraints .Size ;
1010
1111import io .avaje .http .api .Header ;
12+ import io .avaje .http .api .Ignore ;
1213import io .avaje .http .api .QueryParam ;
1314import io .avaje .jsonb .Json ;
1415
@@ -30,6 +31,12 @@ public class GetBeanForm {
3031
3132 @ QueryParam private Set <ServerType > type ;
3233
34+ @ Json .Ignore @ Ignore private String ignored ;
35+
36+ public String getIgnored () {
37+ return ignored ;
38+ }
39+
3340 public String getName () {
3441 return name ;
3542 }
You can’t perform that action at this time.
0 commit comments