<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I don't get what's the good thing to
include @Produces(MediaType.APPLICATION_JSON) to @Stereotype
annotation. <br>
From RESTEASY-1821 reproducer code, It doesn't simplify thing to
annotate @RestService stereotype to SomeRestServce, moreover<br>
it introduces other annotation clash issue as you said. It's
better to let Resteasy process @Produce annotation directly
instead of <br>
CDI container. <br>
<br>
@Path("/some")<br>
@RestService<br>
public class SomeRestService {<br>
@GET<br>
@Path("/")<br>
public Response getSome() {<br>
return Response.ok().entity("{\"x\" : 42, \"y\" :
\"foo\"}").build();<br>
}<br>
}<br>
<br>
Thanks,<br>
Jim<br>
<br>
<pre style="font-size: 1em; margin: 0 10px; margin-top: 10px; width: auto; padding: 0;"><span style="color: gray; font-family: 'Consolas', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important;">
</span></pre>
On 11/01/2018 09:33 PM, Martin Stefanko wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEEDSKXq8A1SZQVRNZycCR_JBuNmd5RfXo266UFd31a3Erp2Ww@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>in my issue [1] I am facing a decision whether to
include CDI stereotype usage also in JAX-RS annotated
methods. The problem is that to allow stereotypes to be
picked up by CDI they need to be placed on the producer
method or field [2] which means they need to be
annotated by <i>javax.enterprise.inject.Produces</i> annotation.
This annotation already clashes with JAX-RS <i>javax.ws.rs.Produces
</i>and additionally impose problems (ambiguous
injection) when several methods with the same return
type would use stereotypes (I've created simple example
at [3]). This is why I want to ask for the community
opinion whether or not should RestEasy support
stereotypes on JAX-RS methods.
<div>
<div dir="ltr"
class="gmail-m_8125003233398168600gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div><br>
</div>
<div>[1] <a
href="https://issues.jboss.org/browse/RESTEASY-1821"
moz-do-not-send="true">https://issues.jboss.org/browse/RESTEASY-1821</a></div>
<div>[2] <a
href="http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#declaring_stereotypes"
target="_blank" moz-do-not-send="true">http://docs.jboss.org/cdi/spec/2.0/cdi-spec.html#declaring_stereotypes</a></div>
<div>[3] <a
href="https://gist.github.com/xstefank/914614d8250cdc40c0047f55cff484a2"
moz-do-not-send="true">https://gist.github.com/xstefank/914614d8250cdc40c0047f55cff484a2</a></div>
<div><br>
</div>
<div>Thank you,</div>
<div>Martin Stefanko</div>
<div><br>
</div>
<div>Software Engineer</div>
<div>JBoss Sustaining Engineering Team</div>
<div>Red Hat</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
resteasy-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:resteasy-dev@lists.jboss.org">resteasy-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/resteasy-dev">https://lists.jboss.org/mailman/listinfo/resteasy-dev</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>