valid-error-template-key
Overview
This rule belongs to the apimatic-codegen-validation
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 | APIMATICCODEGEN_V501 |
Type | Validation |
Rule System | Semantic |
Products Impacted | Code Generation, Developer Experience Portal |
Tags | apimatic code generation codegen sdks portal docs validation apimatic key error template errors exceptions codegen setting endpoint 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.
- XXX is not a valid range.
- 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
- https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
- https://docs.apimatic.io/define-apis/endpoints/#error-response-codes
- https://docs.apimatic.io/api-editor/codegen-settings/
- https://docs.apimatic.io/define-apis/endpoints/#advanced-settings
- https://www.apimatic.io/continuous-code-generation
- https://docs.apimatic.io/rulesets/overview/