Skip to main content

valid-error-templates-codegen-setting-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
MessageError template key is invalid.
CodeOPENAPI3CODEGENSYNTAX_L806
TypeLinting
Rule SystemSyntax
Broad CategoryOpenAPI Code Generation Settings
Products ImpactedCode Generation, Developer Experience Portal
Tagscode generation sdks openapi3 openapi syntax linting apimatic info 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.
  • Error status codes belong to the HTTP status ranges 4XX or 5XX.

For More Information