Subject: Re: bug#45032: 26.3; json-pretty-print of JSON with dict containing 't' as a key causes error

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 04 Dec 2020 11:15:18 +0100

Henry Minsky <[email-masked]> writes:

> If you run M-x json-pretty-print on this buffer contents:
>
> {"t": 259}
>
> You get an error
> Bad JSON object key: t
>
> It seems like the json parser is converting the string "t" into the
> symbol t which is being treated specially?

It's unfortunate that `json-read' is being ambiguous here.

true
=> t

{"t": 259}
=> ((t . 259))

So I don't know how to fix this.  We could add another kludge -- saying
that a boolean used as an object key "obviously" should be a string
instead (when converting back to JSON)?  Opinions?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no