I have some JSON retrieved from a database that I cannot alter. I want to polymorphically deserialise based on a field in the object. I understand I can supply a custom name via the attribute [JsonPolymorphic(TypeDiscriminatorPropertyName = "$discriminator")]
but this complains as the field I want to use is not the first of the object. Is my only option here a full custom converter or is there a simpler way to just specify the field I want when it's not the first?
Asked
Active
Viewed 14 times
0

SeeNoWeevil
- 2,549
- 4
- 26
- 39
-
1Can you add the exact error message? – Fildor Jul 29 '23 at 18:26