The following tables describe the attributes that can be defined for different data types.
General attributes
These attributes are available for all data types.
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Name |
Name of the data type or property. |
Root element for the data type or property definition. |
Description |
Description of the property. |
|
Required |
Boolean, defines whether a property is required or optional. |
|
Restrictions |
Defines whether the property is available in the request, response or both. |
|
Examples |
Sample values for the property. They can be returned when using an API mock. |
|
Object attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Additional properties |
Boolean, defines whether the object accepts properties not included in the data type definition. This is enabled by default. |
|
Array attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Min items and Max items |
Minimum and maximum number of items in an array. |
|
Unique items |
Boolean, defines whether each item in an array must be unique. |
|
String attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Enum |
Possible values for the property. |
|
Min length and Max length |
Minimum and maximum number of bytes in the value. |
|
Pattern |
Regular expression that the value should match. |
|
Default |
Value to use if a value is not provided. |
|
Number and integer attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Enum |
Possible values for the property. |
|
Format |
Format to use for a number or integer. |
|
Minimum and Maximum |
Minimum and maximum value of a number or integer. |
|
Default |
Value to use if a value is not provided. |
|
Date and time attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Enum |
Possible values for the property. |
|
Default |
Value to use if a value is not provided. |
|
Datetime attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Enum |
Possible values for the property. |
|
Format |
Format to use for a datetime. |
|
File attributes
Field | Description | Corresponding OAS/Swagger and RAML element |
---|---|---|
Min length and Max length |
Minimum and maximum number of bytes in the value. |
|
File types |
Type of file to use, in the format |
|