[jboss-jira] [JBoss JIRA] (WFLY-8136) allow JAX-RS @Produces in CDI @Stereotype
Stuart Douglas (JIRA)
issues at jboss.org
Mon Feb 20 00:13:00 EST 2017
[ https://issues.jboss.org/browse/WFLY-8136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stuart Douglas updated WFLY-8136:
---------------------------------
Component/s: REST
> allow JAX-RS @Produces in CDI @Stereotype
> -----------------------------------------
>
> Key: WFLY-8136
> URL: https://issues.jboss.org/browse/WFLY-8136
> Project: WildFly
> Issue Type: Feature Request
> Components: CDI / Weld, REST
> Affects Versions: 9.0.1.Final
> Environment: Windows 7, JDK 1.8.0_60
> Reporter: Andreas Klemp
> Assignee: Alessio Soldano
>
> 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.
> {code}
> @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();
> }
> }
> {code}
> Using the following dependencies in Gradle project.
> {noformat}
> 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']
> )
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list