Re: [netmod] json empty leaf encoding strangeness [Re: WG Last Call for draft-ietf-netmod-yang-json-04 (until 2015-06-29)]

Carsten Bormann <cabo@tzi.org> Sat, 18 December 2021 14:13 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 34B2C3A0EB1 for <netmod@ietfa.amsl.com>; Sat, 18 Dec 2021 06:13:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K28y9_1esU0s for <netmod@ietfa.amsl.com>; Sat, 18 Dec 2021 06:13:49 -0800 (PST)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::15]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C41CE3A0EAF for <netmod@ietf.org>; Sat, 18 Dec 2021 06:13:48 -0800 (PST)
Received: from [192.168.217.118] (p5089a436.dip0.t-ipconnect.de [80.137.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4JGSWW5fbSzDCkt; Sat, 18 Dec 2021 15:13:43 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <DE0EA6BB-A3FB-40C9-BBDB-8ED8200E7FEE@chopps.org>
Date: Sat, 18 Dec 2021 15:13:42 +0100
Cc: Eliot Lear <lear@lear.ch>, "netmod@ietf.org" <netmod@ietf.org>, Ladislav Lhotka <lhotka@nic.cz>
X-Mao-Original-Outgoing-Id: 661529622.651626-eb302c9a180cad698e3d8b25fbf3c7ef
Content-Transfer-Encoding: quoted-printable
Message-Id: <BAB445A8-2627-4414-A3FA-51F42CE5C73D@tzi.org>
References: <D1A4CEB7.B22F7%kwatsen@juniper.net> <20150624145325.GB38016@elstar.local> <m2lhf27sko.fsf@birdie.labs.nic.cz> <1640D503-A676-4BC5-82E6-E08ED04F7106@chopps.org> <4d8189be-aeea-9ed9-b43f-80580acd2b9a@lear.ch> <1FE71A45-2B1A-4B46-96FF-A1D781F4C47D@tzi.org> <DE0EA6BB-A3FB-40C9-BBDB-8ED8200E7FEE@chopps.org>
To: Christian Hopps <chopps@chopps.org>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/L4XmD27jqSt9jbSpCXFICtqL0lk>
Subject: Re: [netmod] json empty leaf encoding strangeness [Re: WG Last Call for draft-ietf-netmod-yang-json-04 (until 2015-06-29)]
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Dec 2021 14:13:54 -0000

On 2021-12-18, at 14:35, Christian Hopps <chopps@chopps.org> wrote:
> 
> This isn't about the YANG specification in general, or making YANG conform to any particular language. It's just about the a choice in the specification for the encoding of YANG in a particular format (JSON).

I understand the objective to have a good representation for YANG data.

For instance, in YANG-CBOR, a YANG empty is represented as a CBOR null (0xf6, in case you need to visualize the bits); there is no expectation that this will be difficult to handle by CBOR implementations.

However, there is nothing wrong with representing empty with the array »[null]« in YANG-JSON.  It is just more complex, and apparently unnecessarily so.
Whether removing this complexity to save two characters is worth doing an incompatible upgrade to the YANG-JSON representation format can be debated.
I’d say: emphatically no.

The other motivation that came up in this thread is that it is natural to have null as a value in JSON and YANG cannot describe such formats via YANG-JSON.  This was what I was reacting to, but, as you say, that wasn’t your question.

Grüße, Carsten