Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageRequired property items from array type Schema Object is missing.
CodeOPENAPI3STANDARDS_V329
TypeValidation
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 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 items property with an empty object value i.e. items: {}
  • If the current schema is not expected to be an array, change the Schema type value from array to some other valid OpenAPI type.

For More Information