Say class A has a field called field1 which is instance of class B.
Class C has field1 which is instance of class D
Mapping directly from A->D is failing unless we register mapping from B->D
class B:
pass
class A:
field1: B
class D:
pass
class C:
field1: D
mapper.to(C).map(A()) - fails
mapper.add(B,D)
mapper.to(C).map(A()) - now succeeds
Example fiddle : https://python-fiddle.com/saved/8999c303-a806-417c-9bdd-d3f3f5206513
It would be great if the mapper automatically handle this.