private boolean handleAdditionalAnnotation ( List < Parameter > parameters , Annotation annotation , final Type type , Set < Type > typesToSkip , javax . ws . rs . Consumes classConsumes , javax . ws . rs . Consumes methodConsumes , Components components , boolean includeRequestBody ) { boolean processed = false ; if ( BeanParam . class . isAssignableFrom ( annotation . getClass ( ) ) ) { // Use Jackson's logic for processing Beans final BeanDescription beanDesc = mapper . getSerializationConfig ( ) . introspect ( constructType ( type ) ) ; final List < BeanPropertyDefinition > properties = beanDesc . findProperties ( ) ; for ( final BeanPropertyDefinition propDef : properties ) { final AnnotatedField field = propDef . getField ( ) ; final AnnotatedMethod setter = propDef . getSetter ( ) ; final AnnotatedMethod getter = propDef . getGetter ( ) ; final List < Annotation > paramAnnotations = new ArrayList < Annotation > ( ) ; final Iterator < OpenAPIExtension > extensions = OpenAPIExtensions . chain ( ) ; Type paramType = null ; // Gather the field's details if ( field != null ) { paramType = field . getType ( ) ; for ( final Annotation fieldAnnotation : field . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } // Gather the setter's details but only the ones we need if ( setter != null ) { // Do not set the param class/type from the setter if the values are already identified if ( paramType == null ) { // paramType will stay null if there is no parameter paramType = setter . getParameterType ( 0 ) ; } for ( final Annotation fieldAnnotation : setter . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } // Gather the getter's details but only the ones we need if ( getter != null ) { // Do not set the param class/type from the getter if the values are already identified if ( paramType == null ) { paramType = getter . getType ( ) ; } for ( final Annotation fieldAnnotation : getter . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } if ( paramType == null ) { continue ; } // Re-process all Bean fields and let the default swagger-jaxrs/swagger-jersey-jaxrs processors do their thing List < Parameter > extracted = extensions . next ( ) . extractParameters ( paramAnnotations , paramType , typesToSkip , components , classConsumes , methodConsumes , includeRequestBody , extensions ) . parameters ; for ( Parameter p : extracted ) { if ( ParameterProcessor . applyAnnotations ( p , paramType , paramAnnotations , components , classConsumes == null ? new String [ 0 ] : classConsumes . value ( ) , methodConsumes == null ? new String [ 0 ] : methodConsumes . value ( ) ) != null ) { parameters . add ( p ) ; } } processed = true ; } } return processed ; }
Adds additional annotation processing support