exception-model-only-for-error
Overview
This rule belongs to the apimatic-preliminary-validation ruleset and states that:
Exception types can only be referenced by error definitions. All other entities can only reference a Structure or Enumeration type model.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Exception model is being referenced by a component other than an error definition which is not allowed. |
| Code | APIMATICPRE_V406 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Types |
| Products Impacted | Code Generation, Developer Experience Portal, API Transformer |
| Tags | preliminary checks validation apimatic exception error response type custom type model complex model |
Suggested Fixes
- Change the type of model to a structure type if it is not intended to be used as an error model.
- Create a structure type for this model with a different name and reference that instead.