The Guid deserializer is very fragile and needs to be more robust in how it handles Guids.
Lower case values break. Empty string breaks.
In the cases where an invalid guid is found (such as "") the deserializer should default to the default of a Guid which is Guid.Empty instead of throwing an exception.
System.ArgumentException: Invalid Guid Pattern.
at Utf8Json.Internal.GuidBits..ctor(ArraySegment`1& utf8string)
at Utf8Json.Formatters.GuidFormatter.Deserialize(JsonReader& reader, IJsonFormatterResolver formatterResolver)
at Deserialize(Object[] , JsonReader& , IJsonFormatterResolver )
at Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)
at Utf8Json.JsonSerializer.Deserialize[T](Stream stream, IJsonFormatterResolver resolver)
The Guid deserializer is very fragile and needs to be more robust in how it handles Guids.
Lower case values break. Empty string breaks.
In the cases where an invalid guid is found (such as
""
) the deserializer should default to thedefault
of a Guid which isGuid.Empty
instead of throwing an exception.