I’m calling an API service that wraps all responses surrounded by a Response element:
<?xml version="1.0" encoding="UTF-8"?>
<Response xmlns="http://www.example.com/stuff">
<status upstairs="Normal" downstairs="Normal"/>
</Response>
My status class is:
class status {
public string upstairs { get; set; }
public string downstairs { get; set; }
}
I’m calling RestSharp to get the status (and prior to V106 this worked):
var client = new RestClient("http://www.example.com");
var request = new RestRequest("/api?get=status", Method.Get);
var response = client.Execute<status>(request);
if (response.Status.Equals(OK))
{
var status = response.Data;
}
With the current version of RestSharp I see in response.Content that the data is there, however the deserializer failed with error
"<Response xmlns="http://www.example.com/stuff"> was not expected."
How do I specify that there is a parent element, but to ignore it?