required-array-schema-items
Overview
This rule belongs to the openapi-v3-standards-validation ruleset and states that:
The Schema Object of an OpenAPI 3.0.x document must define the array items using the items property if the schema type is set as array.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Required property items from array type Schema Object is missing. |
| Code | OPENAPI3STANDARDS_V329 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi standards semantic validation items arrays schema json schema validation json schema |
Suggested Fixes
- Ensure that the array type Schema Object contains the property
items. - If the type of array items is unknown, simply add the
itemsproperty with an empty object value i.e.items: {} - If the current schema is not expected to be an array, change the Schema
typevalue fromarrayto some other valid OpenAPI type.