Property defined for an array item is not applicable to the array item type

Issue ID: warning-items-property-improper

Description

A property defined for an array item is not applicable to the type of the array item.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this issue could look in your API definition. The array accepts string items but also has the property maximum defined which is a property of integers and numbers:

{
    "name": "someArray",
    "in": "body",
    "type": "array",
    "items": {
        "type": "string",
        "pattern": "^[A-Za-z0-9]{3,8}$",
        "maximum": 8
    }
}

Remediation

Make sure that all properties defined for array items match the array item type.

{
    "name": "someArray",
    "in": "body",
    "type": "array",
    "items": {
        "type": "string",
        "pattern": "^^[A-Za-z0-9]{3,8}$",
        "maxLength": 8
    }
}