Skip to main content

schema-contains-exists-for-max-contains

Overview

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

The property maxContains should only be used when the property contains is also set in the same Schema Object. If contains is not present, maxContains has no effect.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageMissing corresponding contains property in the Schema Object for maxContains.
CodeOPENAPI3STANDARDS_L166
TypeLinting
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting max contains contains array schema

Suggested Fixes

  • Define the property contains in the Schema Object along with maxContains.
  • Remove the property maxContains from the Schema Object if contains property is not expected to be set.

For More Information