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

Martin Bjorklund <mbj@tail-f.com> Fri, 23 January 2015 12:08 UTC

Return-Path: <mbj@tail-f.com>
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 171D41A909B for <netmod@ietfa.amsl.com>; Fri, 23 Jan 2015 04:08:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.31
X-Spam-Level:
X-Spam-Status: No, score=-1.31 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_34=0.6, 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 inOdA7LMU8SH for <netmod@ietfa.amsl.com>; Fri, 23 Jan 2015 04:08:15 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [83.241.162.140]) by ietfa.amsl.com (Postfix) with ESMTP id DD0A21A19FA for <netmod@ietf.org>; Fri, 23 Jan 2015 04:08:14 -0800 (PST)
Received: from localhost (x15.tail-f.com [192.168.1.60]) by mail.tail-f.com (Postfix) with ESMTPSA id 24CE61280052; Fri, 23 Jan 2015 13:08:14 +0100 (CET)
Date: Fri, 23 Jan 2015 13:08:14 +0100
Message-Id: <20150123.130814.797514719780233079.mbj@tail-f.com>
To: andy@yumaworks.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <CABCOCHTKvT1M71Fg+M5818a_XLwN-CRN8xpxBsDqvgjU7E5ZgQ@mail.gmail.com>
References: <20150123075651.GA37850@elstar.local> <m2egqln6s0.fsf@nic.cz> <CABCOCHTKvT1M71Fg+M5818a_XLwN-CRN8xpxBsDqvgjU7E5ZgQ@mail.gmail.com>
X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/6m2ubw3PxblFJluh07ajIyZYSHc>
Cc: 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
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 12:08:20 -0000

Andy Bierman <andy@yumaworks.com> wrote:
> On Fri, Jan 23, 2015 at 2:14 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
> > Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> writes:
> >
> >> 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
> >
> > Well, I fully agree that YANG types should be authoritative but,
> > strangely enough, it leads me to a completely different conclusion: If a
> > leaf is defined as uint8, and both parties are supposed to know that,
> > why should the sender want to encode it as string?
> >
> 
> Because we are talking about anyxml, not uint8.
> The entire point of anyxml is that is carries absolultely
> no YANG schema information whatsoever.
> The peer parsing the node has no way to associate
> uint8 with any sub-node of the anyxml blob.

In the generic case this is true.

But for example in YANG PATCH, the target node is known from the
context, so the anydata blob can/will be parsed according to the
schema.


/martin