@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Repeatable(value=ApiResponses.class) public @interface ApiResponse
Describes a response code and description for an API method, for documentation purposes.
Multiple annotations can be added to cover multiple response types.
ApiResponses
Modifier and Type | Required Element and Description |
---|---|
String |
code
The HTTP status code of the response.
|
String |
message
A short description of the response.
|
Modifier and Type | Optional Element and Description |
---|---|
String[] |
contentType
The content type for this code, if different from the default
|
String |
example
An example return value
|
Class<?> |
response
The type of the response body.
|
ResponseHeader[] |
responseHeaders
A list of possible headers provided alongside the response.
|
public abstract String code
public abstract String message
public abstract ResponseHeader[] responseHeaders
public abstract Class<?> response
public abstract String[] contentType
text/plain
public abstract String example
Copyright © 2017–2019. All rights reserved.