Skip to main content

valid-operation-error-template-message-format

Overview

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

Value of an error template entry must be a valid string message, with support for expression templates.

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

Suggested Fixes

  • Ensure that any curly braces in the error template message are correctly balanced i.e. there are no missing starting or ending curly braces or extra braces present.
  • The error template message should be non-null, non-empty.
  • Make sure that reserved placeholders like $statusCode, $response.header, $response.body are correctly spelled. The placeholder names are compared in a case-sensitive manner.
  • If you are using the {$response.body<#JsonPointer>} placeholder, make sure that you are using valid JSON pointer syntax.

For More Information