valid-error-templates-codegen-setting-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.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Error template message is invalid. |
Code | OPENAPI3CODEGENSYNTAX_L807 |
Type | Linting |
Rule System | Syntax |
Broad Category | OpenAPI Code Generation Settings |
Products Impacted | Code Generation, Developer Experience Portal |
Tags | code generation sdks openapi3 openapi syntax linting apimatic info 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
- https://www.rfc-editor.org/rfc/rfc6901
- https://docs.apimatic.io/specification-extensions/swagger-codegen-extensions/#error-templates
- https://docs.apimatic.io/specification-extensions/swagger-codegen-extensions/#error-template-message-syntax
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://docs.apimatic.io/rulesets/overview/