Skip to content

MVC routes don't have custom annotations in attributes #3582

Closed
@tpoll

Description

@tpoll

On upgrading from 3.0.5 -> 3.5.1, we noticed that all of our custom annotations on mvc routes + mvc methods doesn't seem to work.

e.g. given an annotation like:

@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface MyTestAnnotation {
  String value() default "";
}

and a mvc route like

@MyTestAnnotation
public class TestResource {

  @Inject
  public TestResource() {
  }

  @GET("/hello")
  public String helloWorld(@QueryParam String property) {
    return "hello world" + "property"
  }
}

MyTestAnnotation doesn't appear in ctx.attributes map. I've tested both at the class level and the resource level, and neither seem to work.

The new generated code isn't setting any attributes, If I decompile the route class file from jooby 3.0.5, I can see the attribute properly being set.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions