Package io.swagger.annotations
Annotation Type ApiModelProperty
-
@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface ApiModelProperty
Adds and manipulates data of a model property.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description StringaccessAllows for filtering a property from the API documentation.ApiModelProperty.AccessModeaccessModeAllows to specify the access mode of a model property (AccessMode.READ_ONLY, READ_WRITE)StringallowableValuesLimits the acceptable values for this parameter.booleanallowEmptyValueAllows passing an empty valueStringdataTypeThe data type of the parameter.StringexampleA sample value for the property.Extension[]extensionsbooleanhiddenAllows a model property to be hidden in the Swagger model definition.StringnameAllows overriding the name of the property.StringnotesCurrently not in use.intpositionAllows explicitly ordering the property in the model.booleanreadOnlyDeprecated.As of 1.5.19, replaced byaccessMode()StringreferenceSpecifies a reference to the corresponding type definition, overrides any other metadata specifiedbooleanrequiredSpecifies if the parameter is required or not.StringvalueA brief description of this property.
-
-
-
Element Detail
-
value
String value
A brief description of this property.- Default:
- ""
-
-
-
name
String name
Allows overriding the name of the property.- Returns:
- the overridden property name
- 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 property from the API documentation. See io.swagger.core.filter.SwaggerSpecFilter.- Default:
- ""
-
-
-
notes
String notes
Currently not in use.- Default:
- ""
-
-
-
dataType
String dataType
The data type of the parameter.This can be the class name or a primitive. The value will override the data type as read from the class property.
- Default:
- ""
-
-
-
hidden
boolean hidden
Allows a model property to be hidden in the Swagger model definition.- Default:
- false
-
-
-
example
String example
A sample value for the property.- Default:
- ""
-
-
-
readOnly
@Deprecated boolean readOnly
Deprecated.As of 1.5.19, replaced byaccessMode()Allows a model property to be designated as read only.- Default:
- false
-
-
-
accessMode
ApiModelProperty.AccessMode accessMode
Allows to specify the access mode of a model property (AccessMode.READ_ONLY, READ_WRITE)- Since:
- 1.5.19
- Default:
- io.swagger.annotations.ApiModelProperty.AccessMode.AUTO
-
-
-
reference
String reference
Specifies a reference to the corresponding type definition, overrides any other metadata specified- Default:
- ""
-
-
-
extensions
Extension[] extensions
- Returns:
- an optional array of extensions
- Default:
- {@io.swagger.annotations.Extension(properties={@io.swagger.annotations.ExtensionProperty(name="", value="")})}
-
-