-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
Description
Motivation
I want to fetch my model A class using client.getItems(A.class, params). The problem is that conversion for custom types is not working deeper in hierarchy.
@ContentItemMapping("a")
class A {
@ContentItemMapping("b") List<B> bList;
}
@ContentItemMapping("b")
class B {
@ElementMapping("name") String name;
@ContentItemMapping("b") List<C> cList;
}
@ContentItemMapping("c")
class C {
@ElementMapping("name") String name;
}
Class A will contain list of B classes, but inside this class List<C> cList will be mapped to empty list (String name inside B class is ok).
If i fetch class B direcly using client.getItems(B.class, params), List<C> cList will be mapped correctly. So it seems it's not working only if im deeper in hierarchy.
Proposed solution
Add support to nested custom models mapping.
Additional context
There is also parameter linkedItemsDepth(int), but it seems that this is only valid for ContentItem object model, not custom models.