RestSharp Deserialization with JSON Array

I had a slightly different issue when my deserialization POCO contained an array..

Changing it from Devices[] to List<Devices> resolved the issue and it deserialized correctly.


RestSharp only operates on properties, it does not deserialize to fields, so make sure to convert your Devices and Device fields to properties.

Also, double check the Content-Type of the response, if the responses is something non-default, RestSharp may not uses the JsonDeserializer at all. See my answer on RestSharp client returns all properties as null when deserializing JSON response

Tags:

C#

Json

Restsharp