no-items-property-with-non-array-type
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
When the items
property is present in a schema, the type must be explicitly defined as array
. Using the items
property with schemas that have explicitly defined non-array types (such as string, number, object, boolean, etc.) can lead to issues with schema validation, code generation, and API documentation tools.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | The items property can only be used with schemas that have type array . |
Code | OPENAPI3APIMATIC_L703 |
Type | Linting |
Rule System | Semantic |
Broad Category | OpenAPI Schemas |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi apimatic semantic linting array type schema items |
Suggested Fixes
- Remove the
items
property from the schema. - Set the schema type to
array
.