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 String
access
Allows for filtering a property from the API documentation.ApiModelProperty.AccessMode
accessMode
Allows to specify the access mode of a model property (AccessMode.READ_ONLY, READ_WRITE)String
allowableValues
Limits the acceptable values for this parameter.boolean
allowEmptyValue
Allows passing an empty valueString
dataType
The data type of the parameter.String
example
A sample value for the property.Extension[]
extensions
boolean
hidden
Allows a model property to be hidden in the Swagger model definition.String
name
Allows overriding the name of the property.String
notes
Currently not in use.int
position
Allows explicitly ordering the property in the model.boolean
readOnly
Deprecated.As of 1.5.19, replaced byaccessMode()
String
reference
Specifies a reference to the corresponding type definition, overrides any other metadata specifiedboolean
required
Specifies if the parameter is required or not.String
value
A 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="")})}
-
-