Deserializing JSON when sometimes array and sometimes object

A very detailed explanation on how to handle this case is available at “Using a Custom JsonConverter to fix bad JSON results”. To summarize, you can extend the default JSON.NET converter doing Annotate the property with the issue [JsonConverter(typeof(SingleValueArrayConverter<OrderItem>))] public List<OrderItem> items; Extend the converter to return a list of your desired type even for … Read more