no-model-circular-dependency
Overview
This rule belongs to the apimatic-preliminary-linting
ruleset and states that:
A model containing one or more required fields (whether inherited or not) which reference the same model either directly or indirectly indicates presence of a circular dependency. Referencing a model (say A) indirectly means the field(s) references another model (say B) which may contain one or more fields that directly or indirectly reference the model under consideration (A).
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Circular dependency detected in model. |
Code | APIMATICPRE_L102 |
Type | Linting |
Rule System | Semantic |
Broad Category | Types/Models |
Products Impacted | Code Generation, Developer Experience Portal, API Transformer |
Tags | preliminary checks linting apimatic circular dependency field property type custom type model complex model |
Suggested Fixes
- A dependency chain like A -> B indicates that one or more fields of model A reference a model B which contains one or more fields that reference back to model A.
- Model indicated at the end of the dependency chain contains one or more fields that reference the model which is under consideration.
- Models containing circular dependencies via required fields is not recommended and may cause issues.