@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) public @interface ApiOperation
Operations with equivalent paths are grouped in a single Operation Object. A combination of a HTTP method and a path creates a unique operation.
Modifier and Type | Required Element and Description |
---|---|
String |
value
Corresponds to the `summary` field of the operation.
|
Modifier and Type | Optional Element and Description |
---|---|
Authorization[] |
authorizations
Corresponds to the `security` field of the Operation Object.
|
int |
code
The HTTP status code of the response.
|
String |
consumes
Corresponds to the `consumes` field of the operation.
|
Extension[] |
extensions |
boolean |
hidden
Hides the operation from the list of operations.
|
String |
httpMethod
Corresponds to the `method` field as the HTTP method used.
|
boolean |
ignoreJsonView
Ignores JsonView annotations while resolving operations and types.
|
String |
nickname
Corresponds to the `operationId` field.
|
String |
notes
Corresponds to the 'notes' field of the operation.
|
int |
position
Deprecated.
|
String |
produces
Corresponds to the `produces` field of the operation.
|
String |
protocols
Sets specific protocols (schemes) for this operation.
|
Class<?> |
response
The response type of the operation.
|
String |
responseContainer
Declares a container wrapping the response.
|
ResponseHeader[] |
responseHeaders
A list of possible headers provided alongside the response.
|
String |
responseReference
Specifies a reference to the response type.
|
String[] |
tags
A list of tags for API documentation control.
|
public abstract String value
Provides a brief description of this operation. Should be 120 characters or less for proper visibility in Swagger-UI.
public abstract String notes
A verbose description of the operation.
public abstract String[] tags
Tags can be used for logical grouping of operations by resources or any other qualifier.
A non-empty value will override the value received from Api.value()
or Api.tags()
for this operation.
public abstract Class<?> response
In JAX-RS applications, the return type of the method would automatically be used, unless it is
javax.ws.rs.core.Response
. In that case, the operation return type would default to `void`
as the actual response type cannot be known.
Setting this property would override any automatically-derived data type.
If the value used is a class representing a primitive (Integer
, Long
, ...)
the corresponding primitive type will be used.
public abstract String responseContainer
Valid values are "List", "Set" or "Map". Any other value will be ignored.
public abstract String responseReference
public abstract String httpMethod
If not stated, in JAX-RS applications, the following JAX-RS annotations would be scanned
and used: @GET
, @HEAD
, @POST
, @PUT
, @DELETE
and @OPTIONS
.
Note that even though not part of the JAX-RS specification, if you create and use the @PATCH
annotation,
it will also be parsed and used. If the httpMethod property is set, it will override the JAX-RS annotation.
For Servlets, you must specify the HTTP method manually.
Acceptable values are "GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS" and "PATCH".
@Deprecated public abstract int position
public abstract String nickname
The operationId is used by third-party tools to uniquely identify this operation. In Swagger 2.0, this is no longer mandatory and if not provided will remain empty.
public abstract String produces
Takes in comma-separated values of content types. For example, "application/json, application/xml" would suggest this operation generates JSON and XML output.
For JAX-RS resources, this would automatically take the value of the @Produces
annotation if such exists. It can also be used to override the @Produces
values
for the Swagger documentation.
public abstract String consumes
Takes in comma-separated values of content types. For example, "application/json, application/xml" would suggest this API Resource accepts JSON and XML input.
For JAX-RS resources, this would automatically take the value of the @Consumes
annotation if such exists. It can also be used to override the @Consumes
values
for the Swagger documentation.
public abstract String protocols
Comma-separated values of the available protocols. Possible values: http, https, ws, wss.
public abstract Authorization[] authorizations
Takes in a list of the authorizations (security requirements) for this operation.
Authorization
public abstract boolean hidden
public abstract ResponseHeader[] responseHeaders
public abstract int code
The value should be one of the formal HTTP Status Code Definitions.
public abstract Extension[] extensions
Copyright © 2019. All Rights Reserved.