Annotation Type ApiResponse
- 
 @Target(METHOD) @Retention(RUNTIME) public @interface ApiResponse Describes a possible response of an operation.This can be used to describe possible success and error codes from your REST API call. You may or may not use this to describe the return type of the operation (normally a successful code), but the successful response should be described as well using the ApiOperation.This annotation can be applied at method or class level; class level annotations will be parsed only if an @ApiResponse annotation with the same code is not defined at method level or in thrown Exception If your API has uses a different response class for these responses, you can describe them here by associating a response class with a response code. Note, Swagger does not allow multiple response types for a single response code. This annotation is not used directly and will not be parsed by Swagger. It should be used within the ApiResponses.- See Also:
- ApiOperation,- ApiResponses
 
- 
- 
Optional Element SummaryOptional Elements Modifier and Type Optional Element Description ExampleexamplesExamples for the response.StringreferenceSpecifies a reference to the response type.Class<?>responseOptional response class to describe the payload of the message.StringresponseContainerDeclares a container wrapping the response.ResponseHeader[]responseHeadersA list of possible headers provided alongside the response.
 
- 
- 
- 
Element Detail- 
codeint code The HTTP status code of the response.The value should be one of the formal HTTP Status Code Definitions. 
 
- 
 - 
- 
messageString message Human-readable message to accompany the response.
 
- 
 - 
- 
responseClass<?> response Optional response class to describe the payload of the message.Corresponds to the `schema` field of the response message object. - Default:
- java.lang.Void.class
 
 
- 
 - 
- 
referenceString reference Specifies a reference to the response type. The specified reference can be either local or remote and will be used as-is, and will override any specified response() class.- Default:
- ""
 
 
- 
 - 
- 
responseHeadersResponseHeader[] responseHeaders A list of possible headers provided alongside the response.- Returns:
- a list of response headers.
 - Default:
- {@io.swagger.annotations.ResponseHeader(name="", response=java.lang.Void.class)}
 
 
- 
 - 
- 
responseContainerString responseContainer Declares a container wrapping the response.Valid values are "List", "Set" or "Map". Any other value will be ignored. - Default:
- ""
 
 
- 
 - 
- 
examplesExample examples Examples for the response.- Returns:
- Since:
- 1.5.20
 - Default:
- @io.swagger.annotations.Example({@io.swagger.annotations.ExampleProperty(value="", mediaType="")})
 
 
- 
 
-