Item format is not applicable to the type the array items

Description

The format you have specified for one or more array items is not consistent with their type. While this is acceptable, it probably is not what you want.

For more details, see the OpenAPI Specification and JSON Schema Validation.

Example

The following is an example of how this issue could look in your API definition. The array accepts items of the type integer, but the format float is not an integer format:

1name: lockCombo
2in: body
3description: Lock combination to add to the list
4required: true
5schema:
6  type: object
7  required:
8    - combination
9  properties:
10    combination:
11      type: array
12      items:
13        type: integer
14        format: float
15

Remediation

Make sure that the formats of all array items match the type of the items.

Numeric parameters type integer can have the format int32 or int64. Numeric parameters type number can have the format float or double.

1name: lockCombo
2in: body
3description: Lock combination to add to the list
4required: true
5schema:
6  type: object
7  required:
8    - combination
9  properties:
10    combination:
11      type: array
12      items:
13        type: integer
14        format: int32
15

Copyright 42Crunch 2021