Facing a bit of a challenge here. The JSON serialized format of some class, we'll call it
A
, that my application reads has changed. I used the
JsonNames
annotation to account for properties that were simply renamed, but there is one property in particular whose name didn't change that went from being (in typescript speak)
string[]
to
{ foo: string, bar: string[] }
. What's the best way to handle this property would could either be a list of strings or a specific class with two properties?
Should I:
• Create a custom serializer for this property which inspects the JSON structure of the property to determine which one it is?
• Create an entire alternative class for
A
and use it as a surrogate after initially trying and failing to deserialize via the old format?
• Some other option?