Skip to main content

schema-max-items-cannot-be-less-than-min-items

Overview

This rule belongs to the openapi-v3-apimatic-linting ruleset and states that:

In OpenAPI specifications, for schemas that include array data types, the maximum number of items allowed in the array must be greater than or equal to the minimum number of items allowed in the array.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageSchema maximum items is less than the minimum items.
CodeOPENAPI3APIMATIC_L690
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Schemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi apimatic semantic linting minimum item greater less maximum item

Suggested Fixes

  • If any schema with an array data type has a maximum number of items that is less than the minimum number of items, update the schema to ensure that the maximum number of items allowed in the array is greater than or equal to the minimum number of items allowed in the array.
  • Ensure that the updated schema is appropriate for the data being represented by the array.

For More Information