77
88import static io .jooby .apt .JoobyProcessor .Options .SKIP_ATTRIBUTE_ANNOTATIONS ;
99import static io .jooby .internal .apt .CodeBlock .indent ;
10- import static io .jooby .internal .apt .CodeBlock .type ;
1110
1211import java .lang .annotation .Retention ;
1312import java .lang .annotation .RetentionPolicy ;
1615
1716import javax .lang .model .element .*;
1817import javax .lang .model .type .TypeMirror ;
19- import javax .lang .model .util .Elements ;
2018import javax .lang .model .util .SimpleAnnotationValueVisitor14 ;
2119import javax .lang .model .util .Types ;
2220
@@ -32,6 +30,8 @@ private record EnumValue(String type, String value) {}
3230 || it .startsWith ("jakarta.ws.rs" )
3331 || it .startsWith ("javax.ws.rs" );
3432
33+ private static final Predicate <String > OPEN_API = it -> it .startsWith ("io.swagger" );
34+
3535 private static final Predicate <String > NULL_ANNOTATION =
3636 it ->
3737 it .endsWith ("NonNull" )
@@ -42,15 +42,13 @@ private record EnumValue(String type, String value) {}
4242 private static final Predicate <String > KOTLIN_ANNOTATION = it -> it .equals ("kotlin.Metadata" );
4343
4444 private static final Predicate <String > ATTR_FILTER =
45- HTTP_ANNOTATION .or (NULL_ANNOTATION ).or (KOTLIN_ANNOTATION );
45+ HTTP_ANNOTATION .or (NULL_ANNOTATION ).or (KOTLIN_ANNOTATION ). or ( OPEN_API ) ;
4646
4747 private final List <String > skip ;
48- private final Elements elements ;
4948 private final Types types ;
5049
5150 public RouteAttributesGenerator (MvcContext context ) {
5251 var environment = context .getProcessingEnvironment ();
53- this .elements = environment .getElementUtils ();
5452 this .types = environment .getTypeUtils ();
5553 this .skip = Options .stringListOpt (environment , SKIP_ATTRIBUTE_ANNOTATIONS );
5654 }
0 commit comments