OK, I am continuing struggle with custom serialize...
# serialization
a
OK, I am continuing struggle with custom serializers. I am building my own analog of PolymorphicSerializer for a class which explicitely contatins type of the value and then the value itself. Everything works, but the problem is that if I follow the examples, then the field which contains actual value lacks the descriptor. Is there a way to generate sum-of-types style descriptor for that field?
d
If it's json you can just read in a
JsonObject
, which doesn't need a descriptor I think.
a
It is not a Json, but even if it was, there is a catch. As far as I understood from source code, Json object serializer is hard wired to work with json encoder. It throws an error if you try to use something different. I currently try to create a Json schema for my API and it uses custom decoder.