HTTP parser: parse object into ExpandoObject

This commit is contained in:
Sipke Schoorstra 2023-05-10 16:10:24 +02:00
parent 7ab08215a9
commit 796c6cbc2b

View file

@ -34,7 +34,7 @@ public class JsonHttpContentParser : IHttpContentParser
if (returnType == null || returnType.IsPrimitive)
return json.ConvertTo(returnType ?? typeof(string))!;
if (returnType != typeof(ExpandoObject))
if (returnType != typeof(ExpandoObject) && returnType != typeof(object))
return JsonSerializer.Deserialize(json, returnType, options)!;
options.Converters.Add(new ExpandoObjectConverterFactory());