no-schema-circular-inheritance
Overview
This rule belongs to the openapi-v3-apimatic-linting
ruleset and states that:
Circular references within schemas are not allowed. A circular reference occurs when one schema references another schema that, in turn, references the original schema, creating a circular dependency. Circular references can lead to issues with data modeling, validation, and may cause infinite loops in processing.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Circular references detected in schema definitions. |
Code | OPENAPI3APIMATIC_L697 |
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 circular inheritance |
Suggested Fixes
- Refactor the schema structure to eliminate the circular reference by modifying the referencing or referenced schemas.
- Consider restructuring the schemas to break the circular dependency or use alternative approaches such as combining schemas or using nested schemas.