3 ms·
.net has a polymorphic serializer where the output json contains a $type field for deserializer to choose the concrete type. It needs to be the very first key
by eknkc 1y ago
.net has a polymorphic serializer where the output json contains a $type field for deserializer to choose the concrete type.
It needs to be the very first key in the object. I’ve been bitten by this because postgresql’s jsonb also does not preserve the key ordering.
I believe the latest .net release addresses this but key ordering does matter sometimes.
- pshirshov 1y agoWhen order is important it can be maintained by an external layer with, e.g. a an encoding into a list of pairs.