Skip to content
Ryan Heaton edited this page Sep 17, 2015 · 2 revisions

Custom Output Type

When you're using JAX-RS, you often find yourself working with javax.ws.rs.core.Response. Enunciate can't determine the output type of the resource method if this is the return type, so it documents the output type as "unknown," "custom," or just "object."

If you know the output type, you can tell Enunciate what it is with the @com.webcohesion.enunciate.metadata.rs.TypeHint annotation (for Enunciate 1, it's named @org.codehaus.enunciate.jaxrs.TypeHint):

@Path(...)
public class MyResource {

  @GET
  @com.webcohesion.enunciate.metadata.rs.TypeHint(MyResource.class)
  javax.ws.rs.core.Response getMyResource(String id) {
    ...
  }

}
Clone this wiki locally