# Using data type attributes

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. | description |
| Required | Boolean, defines whether a property is required or optional. | <ul> <li>OAS 3.0 and Swagger 2.0: Required properties are listed                            in a <span>required</span> element at the object                            level.</li> <li>RAML: <span>required</span> </li> </ul> |
| Restrictions | Defines whether the property is available in the request, response or<br>both. | <ul> <li>OAS 3.0: Properties can have a <span>writeOnly</span> or <span>readOnly</span>                            element with a boolean value.</li> <li>No corresponding element in Swagger 2.0 or RAML 1.0.</li> </ul> |
| Examples | Sample values for the property. They can be returned when using an API<br>mock. | <ul> <li>OAS 3.0 and Swagger 2.0: The first value is used in the                                <span>example</span> element. Other values are                            ignored. <div><span>Information note</span><span>Note:</span> The OAS 3.0 specification includes an                                    <span>examples</span> element, but it is not supported by                                    <span>Talend Cloud API Designer</span>.</div> </li> <li>RAML: <span>examples</span> </li> </ul> |

## Object attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Additional properties | Boolean, defines whether the object accepts properties not<br>included in the data type definition. This is enabled by default. | additionalProperties |

## Array attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Min items and Max items | Minimum and maximum number of items in an array. | minItems and maxItems |
| Unique items | Boolean, defines whether each item in an array must be unique. | <ul> <li>OAS 3.0 and RAML 1.0: <span>uniqueItems</span> </li> <li>No corresponding element in Swagger 2.0.</li> </ul> |

## String attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Enum | Possible values for the property. | enum |
| Min length and Max length | Minimum and maximum number of bytes in the value. | minLength and maxLength |
| Pattern | Regular expression that the value should match. | pattern |
| Default | Value to use if a value is not provided. | default |

## Number and integer attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Enum | Possible values for the property. | enum |
| Format | Format to use for a number or<br>integer. | format |
| Minimum and Maximum | Minimum and maximum value of a number or integer. | minimum and maximum |
| Default | Value to use if a value is not provided. | default |

## Date and time attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Enum | Possible values for the property. | enum |
| Default | Value to use if a value is not provided. | default |

## Datetime attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Enum | Possible values for the property. | enum |
| Format | Format to use for a datetime. | <ul> <li>RAML 1.0: <span>format</span> </li> <li>OAS 3.0: Datetime properties in OAS 3.0 are defined                            as strings with the format <span>date-time</span>. The default                            datetime format used is RFC3339, but if <kbd>rfc2616</kbd>                            is selected, a custom format <span>date-time-rfc2616</span> is                            used.</li> <li>Swagger 2.0: Datetime properties are defined in the                            same way as in OAS 3.0, but Swagger 2.0 does not support custom formats.                            They will be interpreted as RFC3339, regardless of the format                            selected.</li> </ul> |

## File attributes

| Field | Description | Corresponding OAS/Swagger and RAML element |
| --- | --- | --- |
| Min length and Max length | Minimum and maximum number of bytes in the value. | minLength and maxLength |
| File types | Type of file to use, in the format \*/\*. For<br>example: image/png | <ul> <li>RAML 1.0: <span>fileTypes</span> </li> </ul> |