Skip to content

Commit

Permalink
fixed tags
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Mar 11, 2015
1 parent af11d95 commit e11fb95
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

/**
* Marks a class as a Swagger resource.
* <p/>
* <p>
* The resource affects both the root document of Swagger, the Resource
* Listing, and the API Declaration of that specific resource.
* <p/>
* <p>
* Swagger will only include and introspect only classes that are annotated
* with {@code @Api} and will ignore other resources (JAX-RS endpoints, Servlets and
* so on).
Expand All @@ -36,14 +36,16 @@
/**
* The 'path' that is going to be used to host the API Declaration of the
* resource.
* <p/>
* <p>
* For JAX-RS resources, this would normally have the same value as the {@code @Path}
* on the resource, but can be any other value as well. It will serve as the path
* where the documentation is hosted.
* <p/>
* <p>
* For Servlets, this path has to be the path serving the Servlet.
* <p/>
* <p>
* If the value isn't preceded with a slash, one would be added to it.
*
* @return the document location value, or empty string if not set
*/
String value() default "";

Expand All @@ -52,76 +54,99 @@
* Tags can be used for logical grouping of operations by resources or any other qualifier.
*
* @since 1.5.2
*
* @return the array of tags associated with this Api
*/
Tag[] tags() default @Tag(value = "", description = "");

/**
* Corresponds to the `description` field of the Resource Listing API operation.
* <p/>
* <p>
* This should be a short description of the resource.
*
* @return a longer description about this API
*/
String description() default "";

/**
* Corresponds to the `basePath` field of the API Declaration.
* <p/>
* <p>
* The `basePath` is derived automatically by Swagger. This property allows
* overriding the default value if needed.
* overriding the default value if needed. for swagger 2.0 specifications, this
* value is no longer supported
*
* @since 1.3.7
*
* @return the basePath for this operation
*/
@Deprecated
String basePath() default "";

/**
* Optional explicit ordering of this API resource in the Resource Listing.
* As of swagger-spec 2.0, this value is no longer used
*
*
* @return the position of this API in the resource listing
*/
@Deprecated
int position() default 0;

/**
* Corresponds to the `produces` field of the API Declaration.
* <p/>
* <p>
* Takes in comma-separated values of content types.
* For example, "application/json, application/xml" would suggest this API Resource
* generates JSON and XML output.
* <p/>
* <p>
* For JAX-RS resources, this would automatically take the value of the {@code @Produces}
* annotation if such exists. It can also be used to override the {@code @Produces} values
* for the Swagger documentation.
*
* @return the supported media types supported by the server, or an empty string if not set
*/
String produces() default "";

/**
* Corresponds to the `consumes` field of the API Declaration.
* <p/>
* <p>
* Takes in comma-separated values of content types.
* For example, "application/json, application/xml" would suggest this API Resource
* accepts JSON and XML input.
* <p/>
* <p>
* For JAX-RS resources, this would automatically take the value of the {@code @Consumes}
* annotation if such exists. It can also be used to override the {@code @Consumes} values
* for the Swagger documentation.
*
* @return the consumes value, or empty string if not set
*/
String consumes() default "";

/**
* This property is currently not in use.
*
* @return the protocols supported by the server
*/
String protocols() default "";

/**
* Corresponds to the `authorizations` field of the API Declaration.
* <p/>
* <p>
* Takes in a list of the required authorizations for this API Resource.
* This may be overridden by specific operations.
*
* @see Authorization
*
* @return an array of authorizations required by the server, or a single, empty authorization value if not set
*/
Authorization[] authorizations() default @Authorization(value = "", type = "");

/**
* Hides the api.
*
* @since 1.3.8
*
* @return true if the api should be hidden from the swagger documentation
*/
boolean hidden() default false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

/**
* Represents a single parameter in an API Operation.
* <p/>
* <p>
* While {@link com.wordnik.swagger.annotations.ApiParam} is bound to a JAX-RS parameter,
* method or field, this allows you to manually define a parameter in a fine-tuned manner.
* This is the only way to define parameters when using Servlets or other non-JAX-RS
* environments.
* <p/>
* <p>
* This annotation must be used as a value of {@link com.wordnik.swagger.annotations.ApiImplicitParams}
* in order to be parsed.
*
Expand All @@ -37,7 +37,7 @@
public @interface ApiImplicitParam {
/**
* Name of the parameter.
* <p/>
* <p>
* For proper Swagger functionality, follow these rules when naming your parameters based on {@link #paramType()}:
* <ol>
* <li>If {@code paramType} is "path", the name should be the associated section in the path.</li>
Expand All @@ -61,7 +61,7 @@

/**
* Limits the acceptable values for this parameter.
* <p/>
* <p>
* There are three ways to describe the allowable values:
* <ol>
* <li>To set a list of values, provide a comma-separated list surrounded by square brackets.
Expand All @@ -77,7 +77,7 @@

/**
* Specifies if the parameter is required or not.
* <p/>
* <p>
* Path parameters should always be set as required.
*/
boolean required() default false;
Expand All @@ -96,7 +96,7 @@

/**
* The data type of the parameter.
* <p/>
* <p>
* This can be the class name or a primitive.
*/
String dataType() default "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
* Provides additional information about Swagger models.
* <p/>
* <p>
* Classes will be introspected automatically as they are used as types in operations,
* but you may want to manipulate the structure of the models.
*/
Expand All @@ -30,7 +30,7 @@
public @interface ApiModel {
/**
* Provide an alternative name for the model.
* <p/>
* <p>
* By default, the class name is used.
*/
String value() default "";
Expand All @@ -47,7 +47,7 @@

/**
* Supports model inheritance and polymorphism.
* <p/>
* <p>
* This is the name of the field used as a discriminator. Based on this field,
* it would be possible to assert which sub type needs to be used.
*/
Expand Down

0 comments on commit e11fb95

Please sign in to comment.