bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46486: 28.0.50; json-parse-string missing support for key-less json


From: Basil L. Contovounesios
Subject: bug#46486: 28.0.50; json-parse-string missing support for key-less json strings
Date: Sat, 13 Feb 2021 12:35:01 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Philipp <p.stephani2@gmail.com> writes:

>> Am 13.02.2021 um 13:04 schrieb Thomas Hisch <thomas.hisch@ims.co.at>:
>> 
>> 
>> (json-parse-string "\"abc\"")
>> -> progn: could not parse JSON stream: "'[' or '{' expected near '\"abc\"'", 
>> "<string>", 1, 5, 5
>> 
>> Note that strings that neither start with [ nor { are valid JSON objects
>> according to the JSON schema.
>> 
>
> That contradicts RFC 4627, which states: "A JSON text is a serialized object 
> or array."

RFC 4627 is from 2006 and is obsoleted by RFCs 7158, 7159, and 8259, as
well as both versions of ECMA-404, since at least as far back as 2013,
all of which lift the strict object/array restriction.

The current json.c produces maximally compatible JSON text in that all
implementations must accept object/array text, but it would be nice to
support scalar values too.

Thanks,

-- 
Basil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]