From 5aee3af65aeb9422016de1aaffbbd8c69f4159d3 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 16 Oct 2023 15:30:43 +0200 Subject: [PATCH] Update why-not-json --- Internet_Archive_Logo.svg | 1 + _includes/ia-logo.md | 1 + why-not-json.md | 18 ++++++++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 Internet_Archive_Logo.svg create mode 100644 _includes/ia-logo.md diff --git a/Internet_Archive_Logo.svg b/Internet_Archive_Logo.svg new file mode 100644 index 0000000..c81e909 --- /dev/null +++ b/Internet_Archive_Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_includes/ia-logo.md b/_includes/ia-logo.md new file mode 100644 index 0000000..40af533 --- /dev/null +++ b/_includes/ia-logo.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/why-not-json.md b/why-not-json.md index 6d9334d..9fc1f86 100644 --- a/why-not-json.md +++ b/why-not-json.md @@ -11,8 +11,10 @@ JSON offers *syntax* for numbers, strings, booleans, null, arrays and string-keyed maps. However, it suffers from two major problems. First, it offers no *semantics* for the syntax: it is left to each implementation to determine how to treat each JSON term. This causes -[interoperability](http://seriot.ch/parsing_json.php) and even -[security](http://web.archive.org/web/20180906202559/http://docs.couchdb.org/en/stable/cve/2017-12635.html) +[interoperability](http://seriot.ch/parsing_json.php) [{% include ia-logo.md +%}](http://web.archive.org/web/20231016132727/https://seriot.ch/projects/parsing_json.html) and +even [security](https://docs.couchdb.org/en/stable/cve/2017-12635.html) [{% include ia-logo.md +%}](http://web.archive.org/web/20180906202559/http://docs.couchdb.org/en/stable/cve/2017-12635.html) issues. Second, JSON's lack of support for type tags leads to awkward and incompatible *encodings* of type information in terms of the fixed suite of constructors on offer. @@ -154,8 +156,16 @@ choose. In many real cases on the web, poor choices have led to encodings that are irrecoverably ambiguous. **Update 20230123**. [This -article](https://gist.github.com/FeepingCreature/d2fd982f485973a154abcaf0ccb4003c) discusses -another subtle aspect of the problems caused by the lack of tagging in JSON. +article](https://gist.github.com/FeepingCreature/d2fd982f485973a154abcaf0ccb4003c) [{% include ia-logo.md %}](http://web.archive.org/web20231016125428/https://gist.github.com/FeepingCreature/d2fd982f485973a154abcaf0ccb4003c) +discusses another subtle aspect of the problems caused by the lack of tagging in JSON. + +**Update 20231016**. Lack of tagging sometimes [causes implementors to rely on specific +key-value orderings in JSON +objects](https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/stand-alone-json-serialization#type-hint-position-in-json-objects) +[{% include ia-logo.md +%}](http://web.archive.org/web20231016124858/https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/stand-alone-json-serialization#type-hint-position-in-json-objects) +to make sure their `"type"` tag appears first in the text, to allow use of streaming parsers in +deserialization. ## Notes