I have some JSON coming from Last.fm like this:
{
"toptags":{
"@attr":{
"artist":"Whatever",
"album":"Whatever"
}
}
}
Is there a special way to setup RestSharp to get it to recognize the @attr? The @ (AT sign) is causing me problems because I can't create an identifier that will match this.
From looking at the RestSharp source it's possible to enable it to do data contract deserialization, this seems to require a change of the RestSharp source.
Search for
//#define SIMPLE_JSON_DATACONTRACT
in SimpleJson.csThen you'll need to create the data contracts as well (see "@attr" below):
Didn't try it with RestSharp, but it works with this piece of code, RestSharp uses DataContractJsonSerializer, possibly you will have to set the
My test: