Hi,
jumping in and trying a lucky shot...
Is your packaging information correct? Maybe you have specified the impl
class and not the interface on the config file...
Vassilis
On 08/18/2016 05:01 PM, J. Fiala wrote:
That's exactly what I would like to do - if I remove the annotations
from the implementing class methods, they vanish from the WADL.
Best regards,
Johannes
Am 18.08.2016 um 15:54 schrieb Sergey Beryozkin:
It's invalid per the JAX-RS spec - see its annotation inheritance
section, you can not have JAX-RS annotations spread over the interface
and impl, just keep them all on the interface
Cheers, Sergey
On 18/08/16 14:18, J. Fiala wrote:
Sure:
Interface (generated using wadl2java):
@Path("/helloWorld")
public interface HelloWorldResource {
@GET
@Produces("application/json")
@Path("/find")
String sayHello(@QueryParam("name") String name);
}
// @Path is read from the interface correctly
public class HelloWorldServiceImpl implements HelloWorldResource {
// if e.g. @GET is removed, the method will no longer appear in the
generated WADL
// so the annotations at the interface method are effectively ignored
@GET
@Consumes({ "application/json" })
@Produces("application/json")
@Path("/find")
@Description(value = "Say hello service", target = DocTarget.METHOD)
String sayHello(@QueryParam("name") String name) {
return "hello " + name;
}
}
I can also assemble a small example project if you need it.
Best regards,
Johannes
Am 18.08.2016 um 13:21 schrieb Sergey Beryozkin:
Can you prototype here an interface and an impl class please
thanks, Sergey
On 18/08/16 12:11, J. Fiala wrote:
Hi,
No, that has nothing to do with Swagger, I'm only working with the
generated WADL here.
The @Path-annotation on the implementing class can be removed, here
picking up from the interface works correctly.
However, if I remove @GET/@Path/@Consumes/@Produces from the method in
the implementing class, it will vanish from the generated WADL.
So basically all the annotations at the method level in the interface
are ignored (I'm using CXF 3.1.6).
Verified using Spring CXF Boot + using Jboss EAP 6.
Best regards,
Johannes
Am 18.08.2016 um 00:32 schrieb Sergey Beryozkin:
Hmm is it somehow related to that Swagger related issue ? The
interface annotation inheritance works just fine in CXF as far as I
know, as far as enabling JAX-RS endpoints is concerned
Note we've seen users reporting Swagger2feature can not handle it but
a user has just confirmed that it worked fine in the end - we have
another pending issue with Swagger not handling multi-bundle case
well, but that is another story
Sergey
On 17/08/16 18:23, J. Fiala wrote:
Currently annotations in the interface are not parsed by CXF (e.g.
@Path, @GET, @Produces, @Consumes etc.), it will only read from the
implementing API class.
This is especially annoying if wadl2java is used to generate the API
interfaces automatically.
To make it work, one has to manually add the JAXRS-annotations to
each
implementing class.
It would be nice if CXF would read the annotations in the
interface in
the future as well.
Best regards,
Johannes
--
__________________________________
Vassilis Virvilis Ph.D.
Head of IT
Biovista Inc.
Stay tuned
www: http://www.biovista.com
LinkedIn: https://www.linkedin.com/company/biovista
Twitter: https://twitter.com/BiovistaInc/
Facebook: https://www.facebook.com/biovistainc
Vizit (research):
https://www.facebook.com/Biovista-Vizit-888532217910104/?ref=hl
Google+: https://plus.google.com/105184050931054521199
Tumblr: http://biovista.tumblr.com/
YouTube: https://www.youtube.com/user/BiovistaInc
--
US Offices
2421 Ivy Road
Charlottesville, VA 22903
USA
T: +1.434.971.1141
F: +1.434.971.1144
European Offices
34 Rodopoleos Street
Ellinikon, Athens 16777
GREECE
T: +30.210.9629848
F: +30.210.9647606
Biovista is a privately held biotechnology company that finds novel uses
for existing drugs, and profiles their side effects using their
mechanism of action. Biovista develops its own pipeline of drugs in CNS,
oncology, auto-immune and rare diseases. Biovista is collaborating with
biopharmaceutical companies on indication expansion and de-risking of
their portfolios and with the FDA on adverse event prediction.