Comments in JSON
fadefade.com
Comments in JSON
1–10 of 180 posts
Re: Comments in JSON
#2Re: Comments in JSON
#3Re: Comments in JSON
#4This sounds great until some parser uses the comment definition instead of the value. Is it defined in the spec that parsers need to use the last defined value for a key?
Re: Comments in JSON
#5 The names within an object SHOULD be unique.
SHOULD is defined (http://www.ietf.org/rfc/rfc2119) as 3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.
Salient point is that you would need to ensure that you are only using JSON parsers that tolerate duplicate names (and use the last value)Re: Comments in JSON
#6This sounds great until some parser uses the comment definition instead of the value. Is it defined in the spec that parsers need to use the last defined value for a key?
Re: Comments in JSON
#7Re: Comments in JSON
#8This sounds great until some parser uses the comment definition instead of the value. Is it defined in the spec that parsers need to use the last defined value for a key?
Since the order of an object's keys is not guaranteed, it seems like even if a parser respected the last-defined rule, you could still potentially end up with the wrong field last.
Re: Comments in JSON
#9Re: Comments in JSON
#10This sounds great until some parser uses the comment definition instead of the value. Is it defined in the spec that parsers need to use the last defined value for a key?
Not really defined, but since an object is defined as an unordered collection of key/value pairs, a conforming parser could probably shuffle the pairs before parsing them.