<div dir="ltr"><div dir="ltr">I think the idea is that user can group a few JAX-RS annotations together and apply them on more than one resource with the stereotype annotation instead of copy-pasting them every time [1]. But sure, in the issue example case it does not simplify anything.<div><br></div><div>[1] <a href="https://gist.github.com/xstefank/6893d8c9461dd21e1a80e7837fc3492a">https://gist.github.com/xstefank/6893d8c9461dd21e1a80e7837fc3492a</a> <br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div>Thanks,</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><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018 at 10:30 AM Jim Ma &lt;<a href="mailto:ema@redhat.com">ema@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div class="m_2071672148368805369moz-cite-prefix">I don&#39;t get what&#39;s the good thing to
      include @Produces(MediaType.APPLICATION_JSON) to @Stereotype
      annotation. <br>
      From RESTEASY-1821 reproducer code,  It doesn&#39;t simplify thing to
      annotate @RestService stereotype to SomeRestServce, moreover<br>
      it introduces other annotation clash issue as you said. It&#39;s
      better to let Resteasy process @Produce annotation directly
      instead of <br>
      CDI container.   <br>
      <br>
      @Path(&quot;/some&quot;)<br>
      @RestService<br>
      public class SomeRestService {<br>
          @GET<br>
          @Path(&quot;/&quot;)<br>
          public Response getSome() {<br>
              return Response.ok().entity(&quot;{\&quot;x\&quot; : 42, \&quot;y\&quot; :
      \&quot;foo\&quot;}&quot;).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:&#39;Consolas&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,Courier,monospace!important">
</span></pre>
      On 11/01/2018 09:33 PM, Martin Stefanko wrote:<br>
    </div>
    <blockquote type="cite">
      <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&#39;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="m_2071672148368805369gmail-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" target="_blank">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">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" target="_blank">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="m_2071672148368805369mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
resteasy-dev mailing list
<a class="m_2071672148368805369moz-txt-link-abbreviated" href="mailto:resteasy-dev@lists.jboss.org" target="_blank">resteasy-dev@lists.jboss.org</a>
<a class="m_2071672148368805369moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/resteasy-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/resteasy-dev</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </div>

</blockquote></div>