Skip to main content

enum-elements-count-matches-schema-enum-items-count

Overview

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

The x-enum-elements extension is used to provide additional information or metadata for each enum item. The x-enum-elements extension, when used, should have an object count that matches the number of enum items defined in the schema.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageObject count in x-enum-elements extension does not match with the enum items count.
CodeOPENAPI3CODEGEN_L629
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Schemas
Products ImpactedCode Generation, Developer Experience Portal
Tagscode generation sdks openapi3 openapi semantic linting apimatic x-enum-elements enum elements count mismatch

Suggested Fixes

  • Ensure that the object count in the x-enum-elements extension matches the number of enum items.
  • Adjust the object count or the number of enum items to ensure they match each other.

For More Information