• Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 9.0.1.Final, 15.0.0.Final
    • CDI / Weld, REST
    • None

      A simple JAX-RS REST service can be annotated with @Produces to define the resulting mime-type. However, it is not working anymore, when the annotation is moved to a stereotype. The default application/octet-stream is used.

      @Stereotype
      @Produces(MediaType.APPLICATION_JSON)
      @Target(ElementType.TYPE)
      @Retention(RetentionPolicy.RUNTIME)
      public @interface RestService {
      }
      
      @Path("/some")
      @RestService
      public class SomeRestService {
          @GET
          @Path("/")
          public Response getSome() {
              return Response.ok().entity("{\"x\" : 42, \"y\" : \"foo\"}").build();
          }
      }
      

      Using the following dependencies in Gradle project.

      providedCompile(
          [group: 'javax.enterprise', name: 'cdi-api', version: '1.2'],
          [group: 'org.jboss.spec.javax.ws.rs', name: 'jboss-jaxrs-api_2.0_spec', version: '1.0.0.Final'],
          [group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.4']
      )
      

            [WFLY-8136] Allow JAX-RS annotations in CDI @Stereotype

            I'm going to close this. The @Produces annotation should not be a bean defining annotation in my opinion. The @Path @Provider and @ApplicationPath should be the only bean defining annotations. See WFLY-16545.

            James Perkins added a comment - I'm going to close this. The @Produces annotation should not be a bean defining annotation in my opinion. The @Path @Provider and @ApplicationPath should be the only bean defining annotations. See WFLY-16545 .

            The PR is for the wildfly-proposal. Placing this back in the Open state.

            James Perkins added a comment - The PR is for the wildfly-proposal. Placing this back in the Open state.

            There is currently no clear plan for the target release of this feature request.

            Marek Kopecky added a comment - There is currently no clear plan for the target release of this feature request.

              pberan@redhat.com Petr Beran
              aklemp Andreas Klemp (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: