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.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Operation errorTemplates key is invalid. |
| Code | OPENAPI3CODEGENSYNTAX_L241 |
| Type | Linting |
| Rule System | Syntax |
| Broad Category | OpenAPI Operation Settings |
| Products Impacted | Code Generation, Developer Experience Portal |
| Tags | code 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.