Lukasz Kalnik
07/29/2022, 8:57 AM@ToJson implementation: I was using toJson() instead of toJsonValue(). That's why the serialized JSON was escaped like a plain string. It didn't have anything to do with nesting.
But I will switch to a polymorphic adapter factory anyway, because then I won't have to implement from/to JSON functions myself and won't be able to make these kind of errors.