Skip to main content

valid-operation-error-template-key

Overview

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

The key of an error template entry must be a valid error HTTP status code/range (e.g. 4XX, 500) or set to 0 to represent default/undeclared errors.

PropertyValue
EnabledYes
Maximum SeverityError
MessageOperation errorTemplates key is invalid.
CodeOPENAPI3CODEGENSYNTAX_L241
TypeLinting
Rule SystemSyntax
Broad CategoryOpenAPI Operation Settings
Products ImpactedCode Generation, Developer Experience Portal
Tagscode generation sdks openapi3 openapi syntax linting apimatic operation error template key errors codegen setting

Suggested Fixes

  • The key must not be empty or null.
  • The key must not contain trailing or leading spaces.
  • For ranges, use "X" in upper case only. Ranges like 4xX or 4Xx are not valid.
  • If only digits are used, the status must be a valid HTTP status code or 0.

For More Information