Update custom converter with support for additional "primitive" types
This commit is contained in:
parent
e5967fe057
commit
218860c998
|
|
@ -88,7 +88,7 @@ public class PolymorphicObjectConverter : JsonConverter<object>
|
|||
|
||||
newOptions.Converters.RemoveWhere(x => x is PolymorphicObjectConverterFactory);
|
||||
|
||||
if (type.IsPrimitive || value is string or DateTimeOffset or JsonElement)
|
||||
if (type.IsPrimitive || value is string or DateTimeOffset or DateTime or DateOnly or TimeOnly or JsonElement or Guid)
|
||||
{
|
||||
JsonSerializer.Serialize(writer, value, newOptions);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue