-
Notifications
You must be signed in to change notification settings - Fork 200
Custom Output Type
Ryan Heaton edited this page Oct 4, 2023
·
2 revisions
When you're using JAX-RS, you often find yourself working with jakarta.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)
jakarta.ws.rs.core.Response getMyResource(String id) {
...
}
}