manton / JSONFeed

The JSONFeed.org website
Creative Commons Zero v1.0 Universal
942 stars 56 forks source link

Coercing non-string, non-number IDs is not helpful #118

Closed JKingweb closed 5 years ago

JKingweb commented 6 years ago

The description of article IDs states:

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.

manton commented 5 years ago

This was also discussed in #60. Thanks!