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.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Error template key is invalid. |
Code | OPENAPI3CODEGENSYNTAX_L806 |
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 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.