We have a JSON structure where we send an array of key value pairings from our server to the client. For brevity and tidiness, we send the data like this:
"identification": {
"lineItem/latestDate": "2013-04-28",
"lineItem/destination": "test",
"lineItem/quantity": "55"
}
instead of this:
"identification": [
{
"value": "test",
"type": "lineItem/destination"
},
{
"value": "2014-07-25",
"type": "lineItem/latestDate"
},
{
"value": "55",
"type": "lineItem/quantity"
}
]
The problem is our downstream client (who are processing the JSON using C#) say they cannot handle the first format, as the built in json.net functionality does not support it, and they do not know of another that can do it.
Is it possible to deserialize the first format using the built in JSON deserialization in C#? Or does anyone know of another library that can take care of this? I had a look at this question and to me it looks possible.