no-schema-circular-reference-loop
Overview
This rule belongs to the openapi-v3-apimatic-linting ruleset and states that:
If a schema definition references another definition (alias or not), the reference must be resolvable and not form any kind of loop.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | A circular reference found in schema definitions. |
| Code | OPENAPI3APIMATIC_L661 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi apimatic semantic linting schema reference $ref circular loop |
Suggested Fixes
- Ensure that your schema definition does not reference itself, either directly or indirectly via another schema definition.
- If your schema entry is an alias definition, ensure that the alias resolves into a concrete schema definition.
- If the schema alias definition needs to reference another alias definition, ensure that the aliases are not referencing each other and forming a loop which can't be resolved.