@Target(value=TYPE) @Retention(value=RUNTIME) @Inherited public @interface Api
The resource affects both the root document of Swagger, the Resource Listing, and the API Declaration of that specific resource.
Swagger 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 `authorizations` field of the API Declaration.
|
String |
basePath
Deprecated.
|
String |
consumes
Corresponds to the `consumes` field of the API Declaration.
|
String |
description
Corresponds to the `description` field of the Resource Listing API operation.
|
boolean |
hidden
Hides the api.
|
int |
position
Deprecated.
|
String |
produces
Corresponds to the `produces` field of the API Declaration.
|
String |
protocols
This property is currently not in use.
|
String[] |
tags
A list of tags for API documentation control.
|
String |
value
The 'path' that is going to be used to host the API Declaration of the
resource.
|
public abstract String value
For JAX-RS resources, this would normally have the same value as the @Path
on the resource, but can be any other value as well. It will serve as the path
where the documentation is hosted.
For Servlets, this path has to be the path serving the Servlet.
If the value isn't preceded with a slash, one would be added to it.
public abstract String[] tags
public abstract String description
This should be a short description of the resource.
@Deprecated public abstract String basePath
The `basePath` is derived automatically by Swagger. This property allows overriding the default value if needed. for swagger 2.0 specifications, this value is no longer supported
@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 this API Resource 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
public abstract Authorization[] authorizations
Takes in a list of the required authorizations for this API Resource. This may be overridden by specific operations.
Authorization
public abstract boolean hidden
Copyright © 2015. All Rights Reserved.