Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.

"Jernej Tuljak" <jernej.tuljak@mg-soft.si> Wed, 15 February 2017 12:27 UTC

Return-Path: <jernej.tuljak@mg-soft.si>
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 E05BE129ACC for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 04:27:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mg-soft.si
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 9KygXb7od8es for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 04:27:29 -0800 (PST)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id 48300129A13 for <netmod@ietf.org>; Wed, 15 Feb 2017 04:27:29 -0800 (PST)
Received: from jernejthpPC (tp-x61t.mg-soft.si [10.0.0.222]) by galileo.mg-soft.si (Postfix) with ESMTP id 59697C417623; Wed, 15 Feb 2017 13:27:28 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.10.3 galileo.mg-soft.si 59697C417623
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1487161648; bh=3qig5grTTcmOHOZWxaDWA445+XRvDKOzDC9E9rU2GBk=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=ZXEjnsTUAJdKsLWMfrtamQ/isR74hqMggcl1ri+ZtWxm8MtfMprPAZ7iA3cCjzMlB toBJAy4SUSUOEVXpd1YGiuUzMTupzt0+W2VMZSGrgP0xH1uMXdTntUGyR9wdbYLSak PTuTQM1ifFfLUV4dQ3ype4qgExsh3a1MzN4SFKaBh1/swkGAVaZLMfAKmxUpPO3E6h kw3TpldFa1qqxVmHRNrgp8uIC7pcVjt6htatV6mcZKauwf/8SXZ7VY9F75xUEUECid OSVv2CQEWHSBr7VISxEt6hEXrHIGuClhvCvrgrG/CkyofZXnjcDuR8HzLD2PCUTxTD 2xH3KT96MWYSA==
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
To: 'Ladislav Lhotka' <lhotka@nic.cz>
References: <1487080134376.87476@cisco.com> <1487105934602.29661@Aviatnet.com> <106501d28774$a0b5a2a0$e220e7e0$@mg-soft.si> <C3D06898-E9AF-4AB1-9982-146550E4A6E2@nic.cz>
In-Reply-To: <C3D06898-E9AF-4AB1-9982-146550E4A6E2@nic.cz>
Date: Wed, 15 Feb 2017 13:27:26 +0100
Message-ID: <109901d28786$ddf2ccd0$99d86670$@mg-soft.si>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 15.0
Content-Language: sl
Thread-Index: AQMWBYeP7gKNQW8o/AOiwx9yhMffuQMpt1hYAZ9uoM8BxndNb56udnBw
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/QXKT6rjHFbnBosCJH7hf1IwCj0A>
Cc: "'Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco)'" <ifoltin@cisco.com>, "'Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)'" <mciglan@cisco.com>, netmod@ietf.org
Subject: Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: Wed, 15 Feb 2017 12:27:31 -0000

> -----Original Message-----
> From: Ladislav Lhotka [mailto:lhotka@nic.cz]
> Sent: Wednesday, February 15, 2017 11:40 AM
> To: Jernej Tuljak <jernej.tuljak@mg-soft.si>
> Cc: Alex Campbell <Alex.Campbell@Aviatnet.com>; Martin Ciglan -X (mciglan
> - PANTHEON TECHNOLOGIES at Cisco) <mciglan@cisco.com>; Igor Foltin -X
> (ifoltin - PANTHEON TECHNOLOGIES at Cisco) <ifoltin@cisco.com>;
> netmod@ietf.org
> Subject: Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.
> 
> 
> > On 15 Feb 2017, at 11:16, Jernej Tuljak <jernej.tuljak@mg-soft.si> wrote:
> >
> > Plus, "empty keys" were aready allowed in YANG 1.
> 
> Well, keys with "empty" type were not allowed. What you are saying is that
> the same (dubious) effect can be achieved in other ways that were
> permitted in YANG 1.

Indeed. I meant »empty keys«. Quoting is hard. :)

Jernej

> Note also that while if in XML encoding an empty leaf
> and a leaf containing string of length 0 look the same, in JSON encoding they
> are different:
> 
> "first": [null]
> 
> versus
> 
> "first": ""
> 
> >
> > module empty-key {
> >   namespace "org:example:empty-key";
> >   prefix "ek";
> >
> >   container stuff {
> >     list item {
> >       key "first second";
> >       leaf first {
> >         type string {
> >           length 0;
> >         }
> >       }
> >       leaf second {
> >         type string {
> >           pattern '.{0}';
> >         }
> >       }
> >     }
> >   }
> > }
> >
> > Therefore this change removed a redundant (perhaps even broken) rule.
> 
> Agreed.
> 
> Lada
> 
> >
> > https://www.ietf.org/mail-archive/web/netmod/current/msg16763.html
> > Jernej
> >
> > From: netmod [mailto:netmod-bounces@ietf.org] On Behalf Of Alex
> Campbell
> > Sent: Tuesday, February 14, 2017 9:59 PM
> > To: Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)
> <mciglan@cisco.com>
> > Cc: Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco)
> <ifoltin@cisco.com>; netmod@ietf.org
> > Subject: Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.
> >
> > Hi,
> >
> > It means exactly what the summary says. In YANG 1.0 (RFC 6020) we have:
> >    A leaf that is part of the key can be of any built-in or derived
> >    type, except it MUST NOT be the built-in type "empty".
> > and in YANG 1.1 (RFC 7950) we have:
> >    A leaf that is part of the key can be of any built-in or
> >    derived type.
> >
> > In YANG 1.1, leaves of type "empty" are not disallowed from being keys.
> >
> > Note that since leaves of type "empty" only convey information through
> their presence or absence, and since
> > key leaves must always be present, key leaves of type "empty" convey no
> useful information.
> >
> > Alex
> >
> >
> > From: netmod <netmod-bounces@ietf.org> on behalf of Martin Ciglan -X
> (mciglan - PANTHEON TECHNOLOGIES at Cisco) <mciglan@cisco.com>
> > Sent: Wednesday, 15 February 2017 2:48 a.m.
> > To: netmod@ietf.org
> > Cc: Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco)
> > Subject: [netmod] Yang 1.1 change: Allow type "empty" in a key.
> >
> > Hi all
> >
> > Yang 1.1 change:  Allow type "empty" in a key.
> >
> > What is the meaning of this change? We're interested from
> implementation point of view.
> >
> >   Thanks
> >
> >        Martin
> >
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67
> 
> 
> 
>