Skip to content

Swagger annotations are not being retrieved if controller method has an aspect on it #2335

@aspich

Description

@aspich

If an aspect is added to the controller, or any other wrapper which could extend/override the method, some annotations are not being parsed as currently they are looking directly for the method annotations and not for its wrappers. For example, this is currently done in the "applyImplicitParameters":

https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-servlet/src/main/java/io/swagger/servlet/extensions/ServletReaderExtension.java

On the other hand some annotations (such as ApiResponses) are working fine because they are using a Reflect extension to retrieve the annotation:

-> ReflectionUtils.getAnnotation(method, ApiResponses.class);

I reckon the issue would be fixed if all the "apply*" methods in this reader could use this reflect extension instead of the "method.getAnnotation()"

Cheers,
Andrio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions