Package org.apache.tapestry5.annotations

# Annotation Type RestInfo

@Target({METHOD,TYPE}) @Retention(RUNTIME) @Documented @UseWith(PAGE) public @interface RestInfo
Annotation that provides some information about REST event handler methods for OpenAPI description generation. It can be used in methods and also in pages to define defaults used by all methods without the annotation, except for {`returnType()`.

See Also:
  - `OpenApiDescriptionGenerator`
  - `OpenApiTypeDescriber`

- ## Optional Element Summary

  Optional Elements
  Modifier and Type
  Optional Element
  Description
  `String[]`
  `consumes`
  Defines the request body media types supported by the annotated REST event handler method.
  `String[]`
  `produces`
  Defines the media types of the responses provided by the annotated REST event handler method in successful requests.
  `Class<?>`
  `returnType`
  Defines the return type of this REST event handler method in successful requests.

- ## Element Details

  - ### consumes

    String[] consumes
    Defines the request body media types supported by the annotated REST event handler method.
    Default:
      {""}

  - ### produces

    String[] produces
    Defines the media types of the responses provided by the annotated REST event handler method in successful requests.
    Default:
      {""}

  - ### returnType

    Class<?> returnType
    Defines the return type of this REST event handler method in successful requests. This is particularly useful for methods that have Object return type because they may return non-response objects for error reasons, such as `HttpError`.
    Default:
      java.lang.Object.class