From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Yuen Ho Wong Newsgroups: gmane.emacs.bugs Subject: bug#42994: 27.1; json-serialize unable to serialize JSON values Date: Mon, 24 Aug 2020 07:13:18 +0100 Message-ID: References: <4309c1ca-f568-2fb4-cba0-d6e86453a94c@gmail.com> <9105c19a-e812-4c79-b1b9-cc77fabb2faa@default> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40135"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42994@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 24 08:14:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kA5kA-000AML-5n for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 08:14:10 +0200 Original-Received: from localhost ([::1]:57402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kA5k8-00087f-NY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 02:14:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kA5k2-00087X-LV for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 02:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kA5k2-0005O9-CK for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 02:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kA5k2-0006d6-5N for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 02:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jimmy Yuen Ho Wong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 06:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42994 X-GNU-PR-Package: emacs Original-Received: via spool by 42994-submit@debbugs.gnu.org id=B42994.159824962225444 (code B ref 42994); Mon, 24 Aug 2020 06:14:02 +0000 Original-Received: (at 42994) by debbugs.gnu.org; 24 Aug 2020 06:13:42 +0000 Original-Received: from localhost ([127.0.0.1]:55831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kA5jh-0006cK-WC for submit@debbugs.gnu.org; Mon, 24 Aug 2020 02:13:42 -0400 Original-Received: from mail-il1-f175.google.com ([209.85.166.175]:45890) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kA5jg-0006c8-80 for 42994@debbugs.gnu.org; Mon, 24 Aug 2020 02:13:40 -0400 Original-Received: by mail-il1-f175.google.com with SMTP id k4so6247593ilr.12 for <42994@debbugs.gnu.org>; Sun, 23 Aug 2020 23:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jGwoodtPUzSxE+yOtg0y92W11mNPExvMl0HzB3/g0FU=; b=RKC7V5h1wwxt+9rZkp/GE+lExmMw1Utz66USMkK9vqAHPDHbE1D9gVDkNOSNVSXlsH id56nGFpM+5bDKM2ZYz/IdzguWetxilBqaSnqcLUTQmSgsrFuF3pNDoMBu4hQmnVAVX2 cKrNk0sqwo5/LVhyameWOHA8iX7MxSbJYCX7DWstZ3iMq48O0qzY3UVpPaaaCnpcPt5i FR/HH3RPBDUA6r68+gK5WtssxA0sCPcsr+DiSYEMqIIDYxbfLDnU/dMzIKqy9ld87Vyi bfR9V4vT7gEKKjHIOtqTebhaObHz3CfFLhb5FA5LTeQJqtFLc0oVQGVVn1kOsTb+97Fq SJAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jGwoodtPUzSxE+yOtg0y92W11mNPExvMl0HzB3/g0FU=; b=YOsUbO9AFIQGyfbhljN1HBzlAWJp/jfZaP2pIJ1jCdUM57oDnOq7xdVRnZ5BFjzt/N 0YMnN9AZYCxOn5vQRiSTSf/HQ7pkmIEaWYwrz0aq1dV0OXhgPOcSDaN/IcbQzdjq884J cbZpTZ0zWSRScQGbtsfj7aqTI/bttzDb2x6er78h4k42wJRKmQXLom3ciEeQp7egzpXU Y7ib8ZK9I2OabfVwIwKoSjmEeIjAuI5k9hPQwEFSsOvQESz0GZPgFsCWOHLYX17rkdiH 0hNWh/70z9ghIp8Kby25Wtscz7d4iwu2e3D68ZWERV+E3lRnPPL6sYFuKvlCCepX5O05 /3aA== X-Gm-Message-State: AOAM531iHUeIiJtmywIumdhHBYqwbJ42n4wUQDxs50rIILBpaMhpVZGP 3i2GEjzXYqi2JgGAj+n14pEThW1yQq6Ql2cDCbE= X-Google-Smtp-Source: ABdhPJzf4o2a0SHmpZ8EfyPZ/6pFglUGI2rig+D4hUsIE5064vdb8vbrnSlCYiJM2/zh6KjmN82IcVfiaPkQTBdeS/o= X-Received: by 2002:a92:d3c5:: with SMTP id c5mr3422665ilh.159.1598249614460; Sun, 23 Aug 2020 23:13:34 -0700 (PDT) In-Reply-To: <9105c19a-e812-4c79-b1b9-cc77fabb2faa@default> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186112 Archived-At: > For interoperability with other systems etc. that > do not support scalar texts, it can be useful to > have a mode that, likewise, doesn't support/allow > scalars as JSON texts - e.g., a "disable scalars" > mode, which rejects a document that isn't an > object or an array. > > But by default Emacs should support scalar texts. There's no need for any RFC modes. Decoding in Emacs with RFC 4627 is pointless as there are already :null-object and :false-object to enable translation of JSON values in elisp. Providing any kind of mode for encoding is also pointless, as the author sending the JSON should know what the other end expects. If the other side doesn't accept scalars, it'll reject there, and the client author can adjust accordingly.