object type interop
- Section 2.2 is short enough I might as well just paste it.
An object structure is represented as a pair of curly brackets
surrounding zero or more name/value pairs (or members). A
a string. A single colon comes after each name, separating the
name from the value. A single comma separates a value from a
following name. The names within an object SHOULD be unique.
object = begin-object [ member *( value-separator member ) ]
member = string name-separator value
Why is it that "name within an object SHOULD be unique" rather than
"MUST be unique".
The problem here is the RFC also does not say whether or not the
object's name/value list is ordered or unordered, which I believe
also needs to be noted somewhere in the RFC.
The SHOULD wording really throws me off, because if they can not be
unique without violating the RFC then they must be ordered if you are
to resolve lookups by name in an interoperable way. But I would bet
than the intended implementation is for them not to be ordered, in
which case how do you resolve conflicting names? You can't use a
first or last entry as your rule if they are unordered.
This means that JSON implementations are either violating the RFC as
they fail outright on a case that is only recommended in the RFC
(which some do) or they are resolving the name lookup in an un-
IMHO SHOULD should be changed to MUST, and whether object types are
ordered or unordered should be called out somewhere in the RFC.
[Non-text portions of this message have been removed]
> IMHO SHOULD should be changed to MUST, and whether object types areFrom the introduction of the RFC:
> ordered or unordered should be called out somewhere in the RFC.
An object is an unordered collection of zero or more name/value
pairs, where a name is a string and a value is a string, number,
boolean, null, object, or array.