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

Andy Bierman <andy@yumaworks.com> Sat, 18 December 2021 16:34 UTC

Return-Path: <andy@yumaworks.com>
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 A17D93A1032 for <netmod@ietfa.amsl.com>; Sat, 18 Dec 2021 08:34:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.887
X-Spam-Level:
X-Spam-Status: No, score=-1.887 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20210112.gappssmtp.com
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 1KE5q8AZpR8j for <netmod@ietfa.amsl.com>; Sat, 18 Dec 2021 08:33:57 -0800 (PST)
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4D1133A0788 for <netmod@ietf.org>; Sat, 18 Dec 2021 08:33:57 -0800 (PST)
Received: by mail-lf1-x135.google.com with SMTP id k37so11441217lfv.3 for <netmod@ietf.org>; Sat, 18 Dec 2021 08:33:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e0L+Uf9MZQ6VbXEzBREL4rbqmlYPQ6jqVNfZsiSq2mk=; b=BCXbEhE7DZMfGTAYTllBm4Ggv57bwrAvuKdzQR2/Ns73+Z5QxrYtBUZKRPJdKgvTdb MoOofvl+02wZ4Nxsq1lLCM6NdrpQ2w1mkSzM7tm3MVRCZ+TLv+6SlJi2iYNKnIRJBPeN A+BeVHuYx0v61K9HBEeMfQKCONFkYJRlWCB2ez//CzhwjAIdWR4ID3vt6B6k3f0Vr6nU 1HxDumoq3bkPqBknhCSCamNGXU6e7WsleKS+F2Y+kfddnaopTG/QrChj4cqoaIpJFWHr PMsu6uM7KfZZpN+5ylxOjGTJao7tVpaNSlUmDoeCqyG03YPJFUreUxterDFuTBNdXWpT lNoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e0L+Uf9MZQ6VbXEzBREL4rbqmlYPQ6jqVNfZsiSq2mk=; b=wV0fGbRLCswzCxYK9GWIQpRoeOycEUzy+Rs6Lx3P/qeB+QBMAAEO96YCTyLZbcgbk0 7G2feRjJMaFTGEr9wbldUz/GPcipepRZC5StNbjtkW2Y//W1Mfq5ifaTzA0+5rKlfI5z Z5TzNz5QRCDWhT+IB5Q4Lv7MLi/v/oD0ecdpxmkX6s6UO9r9VRigE9CDbvMzKtPVCgpP lCohOYYcuLUFp9woWWUYYfMgnyPgRdrswaY9EIvGcxhGyERpZ4+rDTS0XjSJp7BSMd4F SsVvP1Aw4FUR+lCKGlJKQ/bwjQSofB8kxxWg9zi0hOOCvhUSvT9HUSqi3vm3K4FIeHCO U/7g==
X-Gm-Message-State: AOAM533sVAG45y2F1vPbwoQYYkf0vQJnt2s9F0Fhf3plZKVsj8S2ara7 zQvGxQDWHX2wKnHKDc34uW+Ytoii9A7iDssjDdItYDw8+2s=
X-Google-Smtp-Source: ABdhPJxI9mL4IUV0cjKfoBR9WruiXF3F8qERy42vD+seJ8BostdZ9jHcYtZXWSErO+c0J2OvvUF5VWM2pRjcl+rxfME=
X-Received: by 2002:ac2:5507:: with SMTP id j7mr7625096lfk.635.1639845234909; Sat, 18 Dec 2021 08:33:54 -0800 (PST)
MIME-Version: 1.0
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> <BAB445A8-2627-4414-A3FA-51F42CE5C73D@tzi.org>
In-Reply-To: <BAB445A8-2627-4414-A3FA-51F42CE5C73D@tzi.org>
From: Andy Bierman <andy@yumaworks.com>
Date: Sat, 18 Dec 2021 08:33:43 -0800
Message-ID: <CABCOCHS605h-1_+-UPYCsMTdyNunJdC3RCLB7nYkXwNi+fKNsg@mail.gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Cc: Christian Hopps <chopps@chopps.org>, Ladislav Lhotka <lhotka@nic.cz>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000b6b7d205d36e383e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/d2StQIF3sSuYi5q_cyRrwMCs5Jw>
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 16:34:02 -0000

On Sat, Dec 18, 2021 at 6:14 AM Carsten Bormann <cabo@tzi.org> wrote:

> 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.
>
>
Thank you for caring about backward compatibility and stability.

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
>
>
Andy


> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>