Is this valid json?
{
\"a\" : \"x\",
\"a\" : \"y\"
}
http://jsonlint.com/ says yes.
http://www.json.org/ doesn\'t say anyth
In C# if you deserialise to a Dictionary
it takes the last key value pair:
string json = @"{""a"": ""x"", ""a"": ""y""}";
var d = JsonConvert.DeserializeObject>(json);
// { "a" : "y" }
if you try to deserialise to
class Foo
{
[JsonProperty("a")]
public string Bar { get; set; }
[JsonProperty("a")]
public string Baz { get; set; }
}
var f = JsonConvert.DeserializeObject(json);
you get a Newtonsoft.Json.JsonSerializationException
exception.