Annotation Type ApiResponse
-
@Target({METHOD,TYPE,ANNOTATION_TYPE}) @Retention(RUNTIME) @Inherited @Repeatable(ApiResponses.class) public @interface ApiResponse
The annotation may be used at method level or as field ofOperation
to define one or more responses of the Operation.swagger-jaxrs2 reader engine considers this annotation along with method return type and context as input to resolve the OpenAPI Operation responses.
- See Also:
- Response (OpenAPI specification),
Operation
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Content[]
content
An array containing descriptions of potential response payloads, for different media types.String
description
A short description of the response.Extension[]
extensions
The list of optional extensionsHeader[]
headers
An array of response headers.Link[]
links
An array of operation links that can be followed from the response.String
ref
A reference to a response defined in components responses.String
responseCode
The HTTP response code, or 'default', for the supplied response.boolean
useReturnTypeSchema
Set to true to resolve the response schema from method return type
-
-
-
Element Detail
-
description
String description
A short description of the response.- Returns:
- description of the response
- Default:
- ""
-
-
-
responseCode
String responseCode
The HTTP response code, or 'default', for the supplied response. May only have 1 default entry.- Returns:
- response code
- Default:
- "default"
-
-
-
headers
Header[] headers
An array of response headers. Allows additional information to be included with response.- Returns:
- array of headers
- Default:
- {}
-
-
-
links
Link[] links
An array of operation links that can be followed from the response.- Returns:
- array of links
- Default:
- {}
-
-
-
content
Content[] content
An array containing descriptions of potential response payloads, for different media types.- Returns:
- array of content
- Default:
- {}
-
-
-
extensions
Extension[] extensions
The list of optional extensions- Returns:
- an optional array of extensions
- Default:
- {}
-
-
-
ref
String ref
A reference to a response defined in components responses.- Returns:
- the reference
- Since:
- 2.0.3
- Default:
- ""
-
-