Re: [netmod] VRFY :Y34: remove/deprecate/replace the 'anyxml' statement

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 23 January 2015 07:56 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 585951A036F for <netmod@ietfa.amsl.com>; Thu, 22 Jan 2015 23:56:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.66
X-Spam-Level:
X-Spam-Status: No, score=-1.66 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, J_CHICKENPOX_34=0.6, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01] autolearn=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 hDjY4-RiO4Wp for <netmod@ietfa.amsl.com>; Thu, 22 Jan 2015 23:56:57 -0800 (PST)
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 120AB1A010A for <netmod@ietf.org>; Thu, 22 Jan 2015 23:56:57 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas3.jacobs-university.de (Postfix) with ESMTP id 65805781; Fri, 23 Jan 2015 08:56:55 +0100 (CET)
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 EdOZMByVy8VG; Fri, 23 Jan 2015 08:56:29 +0100 (CET)
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; Fri, 23 Jan 2015 08:56:54 +0100 (CET)
Received: from localhost (demetrius4.jacobs-university.de [212.201.44.49]) by hermes.jacobs-university.de (Postfix) with ESMTP id 6752D20036; Fri, 23 Jan 2015 08:56:54 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius4.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id uMiwiPEI6-eY; Fri, 23 Jan 2015 08:56:53 +0100 (CET)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 9785A20035; Fri, 23 Jan 2015 08:56:52 +0100 (CET)
Received: by elstar.local (Postfix, from userid 501) id 26F9530E4ACB; Fri, 23 Jan 2015 08:56:51 +0100 (CET)
Date: Fri, 23 Jan 2015 08:56:51 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Andy Bierman <andy@yumaworks.com>
Message-ID: <20150123075651.GA37850@elstar.local>
Mail-Followup-To: Andy Bierman <andy@yumaworks.com>, Martin Bjorklund <mbj@tail-f.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <20150107145943.GE13482@elstar.local> <20150108.103728.1499085884469962335.mbj@tail-f.com> <20150121102144.GE32055@elstar.local> <CABCOCHTWZrfK8zwtLsJMtkRgpw9w6pmK3TRPH+5BTe-ywWt+_A@mail.gmail.com> <CABCOCHT2b+2b9sh1bBmxxO96dfLgtErVh5ONB-msEHa-Abeh9A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CABCOCHT2b+2b9sh1bBmxxO96dfLgtErVh5ONB-msEHa-Abeh9A@mail.gmail.com>
User-Agent: Mutt/1.4.2.3i
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/pQTE6tWqYrBgME8f79XvdD2WVCc>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] VRFY :Y34: remove/deprecate/replace the 'anyxml' statement
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
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: <http://www.ietf.org/mail-archive/web/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: Fri, 23 Jan 2015 07:56:59 -0000

On Thu, Jan 22, 2015 at 03:57:36PM -0800, Andy Bierman wrote:
> On Wed, Jan 21, 2015 at 7:05 AM, Andy Bierman <andy@yumaworks.com> wrote:
> > On Wed, Jan 21, 2015 at 2:21 AM, Juergen Schoenwaelder
> > <j.schoenwaelder@jacobs-university.de> wrote:
> >> On Thu, Jan 08, 2015 at 10:37:28AM +0100, Martin Bjorklund wrote:
> >>> Hi,
> >>>
> >>> Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> >>> > The 2014-12-03 virtual interim meeting proposal is to adopt Y34-04.
> >>>
> >>> I don't think Y34-04 is sufficient.  If I understand Y34-04 (add
> >>> 'root) correctly, the difference between it and Y34-02 (add 'anydata')
> >>> is that 'root' is a special case of 'anydata'; i.e., 'root' behaves as
> >>> 'anydata' with the constraint that it only can hande top-level nodes.
> >>>
> >>> As an example of why this is not sufficient, YANG PATCH uses anyxml
> >>> with non-top-level nodes.  It would not be possible to use 'root' in
> >>> this case.  'anydata' would be a better match.
> >>>
> >>
> >> Andy,
> >>
> >> can you please respond to this since you created Y34-04? I now hear
> >> two people in favour of Y34-02 and we had this back in July 2014:
> >>
> >>    2014-07-21 meeting proposal and action: adopt Y34-02, AB to work out
> >>    a concrete proposal.
> >>
> >> So is the main delta of Y34-04 compared to Y34-02 (i) the additional
> >> text (the three list items) or (ii) additional restrictions of "root"
> >> to top-level nodes. (The Y34-04 referes to ncx:root which is not known
> >> to everybody.)
> >>
> >
> >
> > There are corner cases like YANG Patch edit value that need to be
> > anyxml.
> >
> >> Would adoption of Y34-02 with the additional text (the three list
> >> items) of Y34-04 be a workable solution?
> >>
> 
> 
> The discussion in the last VI meeting seemed to favor this solution
> but there is still this issue of JSON -> XML -> JSON round-trip
> conversion of anydata (unstructured data).
> 
> IMO the loss of JSON typing through the XML conversion
> is not an issue because the only schema that matters is
> the YANG anydata.  E.g.,  booleans and numbers are
> just strings. null is not supported.  All simple nodes are
> strings.  There are no keys so there are no real arrays.
> The server may return multiple containers that could
> have been encoded as an array.
>

Yes, the JSON I-D must be updated to define how anydata is encoded.

In general, I believe a JSON receiver must be able to do conversions
if needed, that is, if the JSON type does not match the type of the
YANG data model, the receiver must convert as needed instead of
throwing an error. I believe the YANG type is authoritative, not the
type used in the encoding. Lada may not like this but since the two
type systems do not align 1:1, I think giving the YANG type system
authority is the way to go. And the principle "the receiver converts
as needed" instead of throwing an error follows the Postel principle.

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