Hello!
I have already implemented some basic stuff, but I have problem with mapping nested JSONn arrays into object attributes.
For example, I need to implement this test:
-----
checkLoad(`DummyArraySequential<DummyInteger>`, """{"items":[{"int":111}, {"int":222}]}""",
"DummyArraySequential{items=[DummyInteger{int=111}, DummyInteger{int=222}]}");
class DummyArraySequential<T>(T[] items) {
shared actual String string => classname(this) + "{items=``items``}";
}
class DummyInteger(Integer int) {
shared actual String string => classname(this) + "{int=``int``}";
}
-----
I've implemented function to map JsonObject into DummyInteger: Anything resolveValue<Target>(Value jsonValue, Type<Target> targetType)
But how to build dynamically typed Sequential object (that satisfies Sequential<DummyInteger> in our case) in this function: Anything resolveSequential(JsonArray jsonValue, ClassOrInterface<Sequential<>> targetType) ?
(function have to return this sequential object and caller pass it into constructor of DumyArraySequential).
Or maybe this approach with JSON mapper is totaly wrong at all and there is another idiomatic ceylonic way to do JSON mapping/build such library?
---
Oleg Neklyudov