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

Ladislav Lhotka <lhotka@nic.cz> Fri, 23 January 2015 10:14 UTC

Return-Path: <lhotka@nic.cz>
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 976CA1A044D for <netmod@ietfa.amsl.com>; Fri, 23 Jan 2015 02:14:10 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.3
X-Spam-Level:
X-Spam-Status: No, score=-1.3 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_34=0.6] 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 JCY0Lpn2kPlV for <netmod@ietfa.amsl.com>; Fri, 23 Jan 2015 02:14:08 -0800 (PST)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) by ietfa.amsl.com (Postfix) with ESMTP id 52A011A03A2 for <netmod@ietf.org>; Fri, 23 Jan 2015 02:14:08 -0800 (PST)
Received: from localhost (unknown [195.113.220.110]) by trail.lhotka.name (Postfix) with ESMTPSA id DD9881CC05F5; Fri, 23 Jan 2015 11:14:10 +0100 (CET)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Andy Bierman <andy@yumaworks.com>
In-Reply-To: <20150123075651.GA37850@elstar.local>
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> <20150123075651.GA37850@elstar.local>
User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.51.2 (x86_64-apple-darwin14.0.0)
Date: Fri, 23 Jan 2015 11:14:07 +0100
Message-ID: <m2egqln6s0.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/EBrJ8C6OBjyUxA-eQL_PpoC87gc>
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
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 10:14:10 -0000

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?

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

If Postel principle is so great, why don't we allow 42.0 as a valid
value of uint8? Why don't we allow "001.002.003.004" as a valid IPv4
address?

Lada

>
> /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/>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C