CLOVIS
12/29/2025, 5:49 PMdescriptor should I declare for a custom serializer in a sealed class ? It reads the field type and chooses between the subtype serializers based on it.ephemient
12/30/2025, 1:05 AMCLOVIS
12/30/2025, 8:23 AMtype , even when encoding without polymorphism:
{
"type": "Point",
"coordinates": [
0.1,
2.2
]
}
Because there are quite a few weird things here (e.g. the coordinates becoming an array), I wrote a custom serializer for them.
However, the default serializer for the sealed class gets confused and tries to generate:
{
"type": "Point",
"value": {
"type": "Point",
"coordinates": [
0.1,
2.2
]
}
}
instead of just using the value itself