Detect cyclic dependencies in property definitions #1799
Labels
feature
Relations
Model relations (has many, etc.)
Repository
Issues related to @loopback/repository package
stale
While working on belongsTo relation in #1618, we discovered a need to detect circular dependencies in property definitions and provide a helpful error to users.
Here is a PoC code that did not make it to
master
yet:https://github.com/strongloop/loopback-next/blob/bcd7ee98cc4958ccde595cf26e35e6f53f236401/packages/repository/src/decorators/model.decorator.ts#L90-L110
We should take a closer look at different ways how a cyclic relation can be introduced, write tests to reproduce those cases and then fix the implementation to throw an error that explains the user what went wrong and how to fix the problem.
Acceptance criteria
TBD
The text was updated successfully, but these errors were encountered: