Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageThe items property can only be used with schemas that have type array.
CodeOPENAPI3APIMATIC_L703
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Schemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi apimatic semantic linting array type schema items

Suggested Fixes

  • Remove the items property from the schema.
  • Set the schema type to array.

For More Information