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.
Motivation
I want to fetch my model
Aclass usingclient.getItems(A.class, params). The problem is that conversion for custom types is not working deeper in hierarchy.Class
Awill contain list ofBclasses, but inside this classList<C> cListwill be mapped to empty list (String name insideBclass is ok).If i fetch class
Bdirecly usingclient.getItems(B.class, params),List<C> cListwill 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 forContentItemobject model, not custom models.