>This is the correct behavior. JSON paths can be represented in one of two
>> ways:
...
>I disagree - a key with period in it is valid as per the definition of a
>character:
The issue here isn't the use of the period or single-quote character - it's how
it is used in a path. This is valid per Pivot's JSON serializer:
{ "a'b":100 }
But JSONSerializer.put() accepts a JavaScript path as a key, so this is not:
JSONSerializer.put(root, "a'b", 100);
whereas this is:
JSONSerializer.put(root, "[\"a'b\"]", 100);
It's the equivalent of writing this in JavaScript:
root.a'b = 100;
vs.
root["a'b"] = 100;
The first one obviously isn't valid.
>Unfortunately, the case at the moment is that we don't seem to be able to
>consume valid JSON, as per Sandro's example. Though I agree we should be
>robust enough to consume non-compliant output as well.
Again, it's not the JSON that's invalid. It's the path he's using (which isn't
actually even part of the JSON standard).
>> It also seems to be a common sentiment that the JSON standard should
>> support non-quoted keys.
>Again, that's not something I'm aware of. The spec is clearly laid out on
>the JSON website:
Do a quick search and you'll find various complaints from developers that the
standard should support non-quoted identifiers. But, again, JSONSerializer *is*
compliant with the standard. It's just also compliant with the non-standard.
:-)