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
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
masteryet: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