Skip to content

Commit 186d71a

Browse files
committed
Add note on complex class hierarchy wiring
1 parent c069de8 commit 186d71a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

docs/wiring.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ the wiring works appropriately. This will also contribute to the performance of
5555
Specifying the ``@inject`` as a first decorator is also crucial for FastAPI, other frameworks
5656
using decorators similarly, for closures, and for any types of custom decorators with the injections.
5757

58+
.. note:: Note on complex class hierarchies
59+
60+
If you have complex class hierarchies with ``@inject``, when wiring modules, make sure to include all
61+
modules with decorator. Otherwise partially wired classes might violate Liskov Substitution Principle.
62+
5863
FastAPI example:
5964

6065
.. code-block:: python

0 commit comments

Comments
 (0)