Specify endpoint response media type.
When not specified the default MediaType is application/json,
so we specify this on controllers or methods where the responses
return a different media type.
@Produces(MediaType.TEXT_PLAIN)
@Path("/customers")
class CustomerController {
...
}
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionint
The status code of the route when successful.Specify response media type.
-
Element Details
-
value
String valueSpecify response media type.When not specified the default MediaType is application/json
- Default:
"application/json"
-
statusCode
int statusCodeThe status code of the route when successful.When not specified, the default status are as follows:
GET(200)
POST(201)
PUT(200, void methods 204)
PATCH(200, void methods 204)
DELETE(200, void methods 204)- Default:
0
-