Re: [core] Comments on draft-ietf-core-yang-cbor-00

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Sat, 21 May 2016 11:29 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 72CD412D15A for <core@ietfa.amsl.com>; Sat, 21 May 2016 04:29:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.626
X-Spam-Level:
X-Spam-Status: No, score=-5.626 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-1.426] 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 nxW8gV6QDVBN for <core@ietfa.amsl.com>; Sat, 21 May 2016 04:29:03 -0700 (PDT)
Received: from atlas3.jacobs-university.de (atlas3.jacobs-university.de [212.201.44.18]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 671F012B02E for <core@ietf.org>; Sat, 21 May 2016 04:29:03 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id 922DBAA9; Sat, 21 May 2016 13:29:01 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas3.jacobs-university.de ([10.70.0.220]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10030) with ESMTP id eNT4rBwWk2D7; Sat, 21 May 2016 13:28:34 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas3.jacobs-university.de (Postfix) with ESMTPS; Sat, 21 May 2016 13:29:00 +0200 (CEST)
Received: from localhost (demetrius1.jacobs-university.de [212.201.44.46]) by hermes.jacobs-university.de (Postfix) with ESMTP id D195820050; Sat, 21 May 2016 13:29:00 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius1.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id Tpp7CDY71KjM; Sat, 21 May 2016 13:28:58 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 5195F2004E; Sat, 21 May 2016 13:28:59 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 697CA3AEA729; Sat, 21 May 2016 13:28:58 +0200 (CEST)
Date: Sat, 21 May 2016 13:28:57 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Carsten Bormann <cabo@tzi.org>
Message-ID: <20160521112857.GA4437@elstar.local>
Mail-Followup-To: Carsten Bormann <cabo@tzi.org>, Ladislav Lhotka <lhotka@nic.cz>, Core <core@ietf.org>
References: <CABCOCHRRACvVXx2S_hZm2TxbvP48aO4Q4REkh0LFjmHkMkZ1Vg@mail.gmail.com> <m2y473svm0.fsf@nic.cz> <57401CC2.2040002@tzi.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <57401CC2.2040002@tzi.org>
User-Agent: Mutt/1.6.0 (2016-04-01)
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/ZI_4MA43y8Ikr2qp6e1CUSKhBHk>
Cc: Core <core@ietf.org>
Subject: Re: [core] Comments on draft-ietf-core-yang-cbor-00
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 21 May 2016 11:29:05 -0000

On Sat, May 21, 2016 at 10:30:58AM +0200, Carsten Bormann wrote:
> Ladislav Lhotka wrote:
> > The receiving side will resolve the union type by the first union member
> > type that matches the CBOR-encoded value. It's the same as in JSON encoding.
> 
> Or, at least, similar -- we are not always making the same serialization
> decisions.
> 
> The weird aspect of this part of YANG is that the actual validity (and
> specific semantics and thus usefulness) of a union in the YANG module
> depends on the specifics of the serialization below.

YANG's native serialization of values are untyped strings.

> More frankly: Tying the semantics of a modeling language to one specific
> serialization mechanism is an utterly broken design.

Not necessarily. It may start to look broken once you have
serializations that are typed and for some reasons people think the
type information should impact how YANG works (that assumes values
serialized as untyped strings). Note that type rules differ for
different serializations so you actually have no chance to get away
without any weird corner cases.

> I'm not sure that it can be fixed, though, so we'll likely have to work
> around this breakage.

I disagree that YANG is broken.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>