Package io.swagger.annotations
Annotation Type ApiImplicitParam
-
@Target(METHOD) @Retention(RUNTIME) public @interface ApiImplicitParam
Represents a single parameter in an API Operation.While
ApiParamis 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.This annotation must be used as a value of
ApiImplicitParamsin order to be parsed.- See Also:
ApiImplicitParams
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringaccessAllows for filtering a parameter from the API documentation.StringallowableValuesLimits the acceptable values for this parameter.booleanallowEmptyValueAdds the ability to set a format as emptybooleanallowMultipleSpecifies whether the parameter can accept multiple values by having multiple occurrences.StringcollectionFormatadds ability to override collectionFormat with `array` typesStringdataTypeThe data type of the parameter.Class<?>dataTypeClassThe class of the parameter.StringdefaultValueDescribes the default value for the parameter.Stringexamplea single example for non-body type parametersExampleexamplesExamples for the parameter.StringformatAdds the ability to provide a custom formatStringnameName of the parameter.StringparamTypeThe parameter type of the parameter.booleanreadOnlyadds ability to be designated as read only.booleanrequiredSpecifies if the parameter is required or not.StringtypeAdds the ability to override the detected typeStringvalueA brief description of the parameter.
-
-
-
Element Detail
-
name
String name
Name of the parameter.For proper Swagger functionality, follow these rules when naming your parameters based on
paramType():- If
paramTypeis "path", the name should be the associated section in the path. - For all other cases, the name should be the parameter name as your application expects to accept.
- See Also:
paramType()
- Default:
- ""
- If
-
-
-
value
String value
A brief description of the parameter.- Default:
- ""
-
-
-
defaultValue
String defaultValue
Describes the default value for the parameter.- Default:
- ""
-
-
-
allowableValues
String allowableValues
Limits the acceptable values for this parameter.There are three ways to describe the allowable values:
- To set a list of values, provide a comma-separated list.
For example:
first, second, third. - To set a range of values, start the value with "range", and surrounding by square
brackets include the minimum and maximum values, or round brackets for exclusive minimum and maximum values.
For example:
range[1, 5],range(1, 5),range[1, 5). - To set a minimum/maximum value, use the same format for range but use "infinity"
or "-infinity" as the second value. For example,
range[1, infinity]means the minimum allowable value of this parameter is 1.
- Default:
- ""
- To set a list of values, provide a comma-separated list.
For example:
-
-
-
access
String access
Allows for filtering a parameter from the API documentation.See io.swagger.core.filter.SwaggerSpecFilter for further details.
- Default:
- ""
-
-
-
dataType
String dataType
The data type of the parameter.This can be the class name or a primitive.
- Default:
- ""
-
-
-
dataTypeClass
Class<?> dataTypeClass
The class of the parameter.Overrides
dataTypeif provided.- Default:
- java.lang.Void.class
-
-
-
paramType
String paramType
The parameter type of the parameter.Valid values are
path,query,body,headerorform.- Default:
- ""
-
-
-
example
String example
a single example for non-body type parameters- Returns:
- Since:
- 1.5.4
- Default:
- ""
-
-
-
examples
Example examples
Examples for the parameter. Applies only to BodyParameters- Returns:
- Since:
- 1.5.4
- Default:
- @io.swagger.annotations.Example({@io.swagger.annotations.ExampleProperty(mediaType="", value="")})
-
-
-
type
String type
Adds the ability to override the detected type- Returns:
- Since:
- 1.5.11
- Default:
- ""
-
-
-
format
String format
Adds the ability to provide a custom format- Returns:
- Since:
- 1.5.11
- Default:
- ""
-
-
-
collectionFormat
String collectionFormat
adds ability to override collectionFormat with `array` types- Since:
- 1.5.11
- Default:
- ""
-
-