-
Notifications
You must be signed in to change notification settings - Fork 200
No JAX
Let's say you'd love to use Enunciate's documentation features and you've got a REST API, but you're not using JAX-RS. You've got a couple of options.
One thing you could do is just create some interfaces that define your API in terms of JAX-RS, but don't supply an associated implementation class. Enunciate will pick up on your interfaces and generate the associated documentation.
The problem with option 1 is that you have to maintain the metadata in a separate place from where you maintain your API. There is a higher probability that the documentation will be out-of-sync.
The second option is that you can supply Enunciate with the necessary JAX-RS metadata using the
@com.webcohesion.enunciate.metadata.rs.ResourceMethodSignature
annotation. Here's an example of how you might use this annotation:
@Path("/myresource")
public class MyNonJaxrsResourceClass {
@GET
@ResourceMethodSignature (
output = SomeResource.class,
queryParams = {@QueryParam("param1"), @QueryParam("param2")}
)
public void handleGetSomeResource(HttpServletRequest request, HttpServletResponse response) {
...
}
}