Ayfri
05/07/2023, 1:06 AMkotlinx.ser
, the library absolutely wants to precise the type of an ArrayList in a JSON when in a specific class, but not in another class.
I have this : var conditions: List<Predicate>? = null
, in two different classes, EntityOrPredicate
and LootPool
.
• In EntityOrPredicate
, I serialize my list with a ListSerializer
of a custom serializer, it works perfectly.
• On LootPool
, I do the exact same thing with the same custom serializer, and there, I get an additional "type": "kotlin.collections.ArrayList
entry in the resulting JsonArray, with my Predicates serialized with the custom serializer, as waited.
I really don't know why it's happening and I've tried many many many many things (I lost about 12 to 15h on this problem in total).
Here is my project with the EntityOrPredicate class and the LootPool class (with the custom serializer here), it's a bit messy because I left all my tests and comments.
This is a followup from our old discussion @Ben Woodworth.spand
05/08/2023, 7:35 AMAyfri
05/08/2023, 4:11 PM