| ▲ | CodesInChaos 11 hours ago | |||||||
That depends on how Postel's law is interpreted. What's reasonable is: "Set reserved fields to 0 when writing and ignore them when reading." (I heard that was the original example). Or "Ignore unknown JSON keys" as a modern equivalent. What's harmful is: Accept an ill defined superset of the valid syntax and interpret it in undocumented ways. | ||||||||
| ▲ | tuetuopay 9 hours ago | parent | next [-] | |||||||
Funny I never read the original example. And in my book, it is harmful, and even worse in JSON, since it's the best way to have a typo somewhere go unnoticed for a long time. | ||||||||
| ||||||||
| ▲ | treve 10 hours ago | parent | prev | next [-] | |||||||
Good modern protocols will explicitly define extension points, so 'ingoring unknown JSON keys' is in-spec rather than assumed that an implementer will do. | ||||||||
| ▲ | yxhuvud 9 hours ago | parent | prev [-] | |||||||
I disagree. I find accepting extra random bytes in places to be just as harmful. I prefer APIs that push back and tell me what I did wrong when I mess up. | ||||||||