Though Utf8Json has implemented code to deal with double.Infinite, when trying to deserialize an json array(contains Infinite value) to ExpandoObject, exception is thrown.
The reason is that ReadIsValueSeparatorWithVerify() only allows comma(,). When JsonReader meets "Infinity", ReadIsValueSeparatorWithVerify() is called before ReadDouble().
var input = "{\"array\":[1.1,Infinity,2.0]}"
JsonSerializer.Deserialize<dynamic>(input);
JsonParsingException: expected:',', actual:'I', at offset:14
at void Utf8Json.JsonReader.ReadIsValueSeparatorWithVerify ()
at bool Utf8Json.JsonReader.ReadIsEndArrayWithSkipValueSeparator (ref int count)
at object Utf8Json.Formatters.PrimitiveObjectFormatter.Deserialize (ref JsonReader reader, IJsonFormatterResolver formatterResolver)
at object Utf8Json.Formatters.PrimitiveObjectFormatter.Deserialize (ref JsonReader reader, IJsonFormatterResolver formatterResolver)
at T Utf8Json.JsonSerializer.Deserialize<T> (byte[] bytes, int offset, IJsonFormatterResolver resolver)
at void <<Initialize>>d__0.MoveNext ()
at void System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
at void System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)
at void Xamarin.Interactive.CodeAnalysis.EvaluationContext.<CoreRunAsync>d__27.MoveNext () in EvaluationContext.cs:234
at void System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
at void System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)
at void Xamarin.Interactive.CodeAnalysis.EvaluationContext.<RunAsync>d__26.MoveNext () in EvaluationContext.cs:147
Though Utf8Json has implemented code to deal with double.Infinite, when trying to deserialize an json array(contains Infinite value) to ExpandoObject, exception is thrown.
The reason is that ReadIsValueSeparatorWithVerify() only allows comma(,). When JsonReader meets "Infinity", ReadIsValueSeparatorWithVerify() is called before ReadDouble().