Skip to main content

schema-contains-exists-for-min-contains

Overview

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

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

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

Suggested Fixes

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

For More Information