Skip to main content

at-least-one-item-in-schema-enum-list

Overview

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

If property enum is specified in the Schema Object, it must consist of at least one item in the list.

PropertyValue
EnabledYes
SeverityWarning
MessageNo item found in the enumeration list.
CodeOPENAPI3STANDARDS_L150
TypeLinting
Rule SystemSemantic
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting enum schema

Suggested Fixes

  • Remove the property enum from the Schema Object if you do not intend to add any entries in it.
  • Ensure that no entry in the list is empty i.e. containing only whitespace characters.

For More Information