jersey
  1. jersey
  2. JERSEY-1348

Response.ResponseBuilder#entity does not pass annotations to messagebodywriter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-m06
    • Fix Version/s: 2.0-m08, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      Having a provider

      @Provider
      public class DateContainerReaderWriter implements MessageBodyReader<Date>,
      		MessageBodyWriter<Date> {
      }
      

      than using a resource

      @Path("resource")
      public class Resource {
      	public static final String ENTITY = "ENtiTy";
      
      	@POST
      	@Path("entity")
      	public Response entity(Date date) {
      		Annotation[] annotations = AnnotatedClass.class.getAnnotations();
      		Response response = Response.ok().entity(date, annotations).build();
      		return response;
      	}
      
      }
      

      the @Path and @POST annotations are sent to messagebodywriter, not

      {annotations}

      .

        Activity

        Hide
        jan.supol added a comment -

        Also, ContainerResponseContext#getEntityAnnotations returns @POST and @Path, even though the javadoc says:

        Get the annotations attached to the entity.

        It's likely the the same cause.

        Show
        jan.supol added a comment - Also, ContainerResponseContext#getEntityAnnotations returns @POST and @Path, even though the javadoc says: Get the annotations attached to the entity. It's likely the the same cause.

          People

          • Assignee:
            Miroslav Fuksa
            Reporter:
            jan.supol
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 hours Original Estimate - 3 hours
              3h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 5 hours
              5h