Subject: [netmod] What is a 'list instance' (draft-ietf-netmod-yang-json-04)?

From: Jernej Tuljak <[email-masked]>
Date: Wed, 17 Jun 2015 11:39:35 +0200

Hi,

the YANG/JSON draft is using some wording that confused me (Section 5.4.).

A list instance is encoded as a name/array pair, and the array
elements are JSON objects.

I would have expected it to say something like (judging by examples):

All entires of a list are encoded as a single name/array pair, where the
array elements are JSON objects representing individual list entries.

In RFC6020 (Section 7.8.).

The "list" statement is used to define an interior data node in the
schema tree.  A list node may exist in multiple instances in the data
tree.  Each such instance is known as a list entry.

Which suggests multiple instances of a list. Are you saying that, in 
JSON mapping, there can only be a single list instance?

The last paragraph in 5. also sounds suspicious:

Any data node instance is encoded as a name/value pair where the name
is formed from the data node identifier using the rules ofSection 4  <https://tools.ietf.org/html/draft-ietf-netmod-yang-json-04#section-4>.
The value depends on the category of the data node as explained in
the following subsections.

Jernej

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 17 Jun 2015 12:52:45 +0200

> On 17 Jun 2015, at 11:39, Jernej Tuljak <[email-masked]> wrote:
> 
> Hi,
> 
> Which suggests multiple instances of a list. Are you saying that, in JSON mapping, there can only be a single list instance?

No, what I mean by “list instance” is a counterpart, or materialisation, of a list data node. In 6020(bis), the term “instance” is used somewhat loosely and no definition is provided. This example is in section 7.7.10:

     leaf-list allow-user  {
         type string;
         description "A list of user name patterns to allow";
     }

   A corresponding XML instance example:

     <allow-user>alice</allow-user>
     <allow-user>bob</allow-user>

> is formed from the data node identifier using the rules of 
> Section 4
> .

It’s the same: a data node is in the schema and its instance in the data tree. I already proposed to define the term “data node instance” in YANG spec (or otherwise clarify this issue). 

Lada

> 
> Jernej
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

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