]
Marek Kopecký commented on WFLY-8136:
-------------------------------------
There is currently no clear plan for the target release of this feature request.
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, 15.0.0.Final
Environment: Windows 7, JDK 1.8.0_60
Reporter: Andreas Klemp
Assignee: Martin Stefanko
Priority: Major
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}