If an id is presented as a number or other type, a JSON Feed reader must coerce it to a string.
No suggestion, however, is made about how one would coerce an array or object into a string, and I'm skeptical of the value of true or false or null as IDs. Are true and "true" the same ID, or is it true and "1" (the result of a naïve type conversion in PHP)?
Coercing numbers would seem to make sense, but there's no guarantee that a particular JSON implementation produces the same result (and therefore the same ID) beyond 53 bits of precision---or even below that.
I'd suggest, therefore, that only strings be accepted.
The description of article IDs states:
No suggestion, however, is made about how one would coerce an array or object into a string, and I'm skeptical of the value of
true
orfalse
ornull
as IDs. Aretrue
and"true"
the same ID, or is ittrue
and"1"
(the result of a naïve type conversion in PHP)?Coercing numbers would seem to make sense, but there's no guarantee that a particular JSON implementation produces the same result (and therefore the same ID) beyond 53 bits of precision---or even below that.
I'd suggest, therefore, that only strings be accepted.