restsharp/RestSharp — pull request #292 by petejohanson (2012-06-27 18:08:39+00:00)
Title: Add support for mapping JSON objects to Dictionary<string, string> when ...

...the field values are different for each field, e.g. HAL _embedded object.

The HAL spec (https://github.com/mikekelly/hal-rfc) allows arbitrary "sub-resources" to be embedded in an object's "_embedded" property, e.g.:

{
"_embedded": {
"http://api.server.com/rel/dogs": [ { "name": "scruffy" }, { "name": "fluffy" } ],
"http://api.server.com/rel/favorite_dog": { "name": "scruffy" }
}
}

Because we may have arbitrary properties for the "_embedded" field (since the field names are the 'hypermedia relationship types") and the *values* can be any arbitrary valid JSON object, we really have no choice but to deserialize this to a type like:

public class DogOwner {
public Dictionary _embedded { get; set; }
}

And then later deserialize a given dictionary *value* once we know the type based on the relationship type.

This change allows such a functionality by calling `ToString ()` instead of casting to `string` as is done currently,.