Annotation Interface Produces


@Inherited @Retention(RUNTIME) @Target(TYPE) public @interface Produces
The media type a handler answers in.

Independent of Consumes: what a request carries says nothing about what the answer is written as, and a handler that takes JSON may well answer something else. Declare it on the handler, or once on a base class every handler of that kind extends.

Descriptive, like Consumes: tooling reads it, the router does not. What actually serializes a response is the middleware the route runs under.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description