@Target(value=TYPE) @Retention(value=RUNTIME) @Inherited public @interface Api
By default, Swagger-Core will only include and introspect only classes that are annotated
with @Api
and will ignore other resources (JAX-RS endpoints, Servlets and
so on).
Modifier and Type | Optional Element and Description |
---|---|
Authorization[] |
authorizations
Corresponds to the `security` field of the Operation Object.
|
String |
basePath
Deprecated.
|
String |
consumes
Corresponds to the `consumes` field of the operations under this resource.
|
String |
description
Deprecated.
|
boolean |
hidden
Hides the operations under this resource.
|
int |
position
Deprecated.
|
String |
produces
Corresponds to the `produces` field of the operations under this resource.
|
String |
protocols
Sets specific protocols (schemes) for the operations under this resource.
|
String[] |
tags
A list of tags for API documentation control.
|
String |
value
Implicitly sets a tag for the operations, legacy support (read description).
|
public abstract String value
In swagger-core 1.3.X, this was used as the 'path' that is to host the API Declaration of the resource. This is no longer relevant in swagger-core 1.5.X.
If tags()
is not used, this value will be used to set the tag for the operations described by this
resource. Otherwise, the value will be ignored.
The leading / (if exists) will be removed.
tags()
is defined.public abstract String[] tags
A non-empty value will override the value provided in value()
.
@Deprecated public abstract String description
@Deprecated public abstract String basePath
@Deprecated public abstract int position
public abstract String produces
Takes in comma-separated values of content types. For example, "application/json, application/xml" would suggest the operations generate 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 the operations accept 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 the operations under this resource. This may be overridden by specific operations.
Authorization
public abstract boolean hidden
Copyright © 2015. All Rights Reserved.