You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ToObject calls on JObject or JToken etc inside the ValuesJsonConverter don't pass the current serializer. This is a problem as custom converters on the serializer are never passed through (eg. StringEnumConverter) to the inner deserialization of the token/object.
This would affect all nested properties that have IThing (or anything derived from it) as a potential value.
The fix is basically just passing the instance of JsonSerializer through to the ToObject method calls within ValuesJsonConverter.
I would add a specific way to reproduce this however I came into this issue from a different/complicated angle. I was trying to deserialize a BreadcrumbList where the list item's "item" field wouldn't deserialize because it was an IThing and there was no defined type. When I tried to use my own converter (basically taking the IThing the serialization process saw and making it instantiate Thing), I saw my converter was never passed down the line into the nested properties.
I'm not sure if it is worth fixing for JSON.Net or just something to keep in mind for #100 .
The text was updated successfully, but these errors were encountered:
Turnerj
added
the
bug
Issues describing a bug or pull requests fixing a bug.
label
Dec 8, 2019
The
ToObject
calls onJObject
orJToken
etc inside theValuesJsonConverter
don't pass the current serializer. This is a problem as custom converters on the serializer are never passed through (eg.StringEnumConverter
) to the inner deserialization of the token/object.This would affect all nested properties that have
IThing
(or anything derived from it) as a potential value.The fix is basically just passing the instance of
JsonSerializer
through to theToObject
method calls withinValuesJsonConverter
.I would add a specific way to reproduce this however I came into this issue from a different/complicated angle. I was trying to deserialize a
BreadcrumbList
where the list item's "item" field wouldn't deserialize because it was anIThing
and there was no defined type. When I tried to use my own converter (basically taking theIThing
the serialization process saw and making it instantiateThing
), I saw my converter was never passed down the line into the nested properties.I'm not sure if it is worth fixing for JSON.Net or just something to keep in mind for #100 .
The text was updated successfully, but these errors were encountered: