Subject: [Netconf] draft-ietf-netconf-restconf-04 - Inconsistent JSON serialization between PUT and GET of list item

From: Anton Tkáčik <[email-masked]>
Date: Thu, 12 Mar 2015 13:05:29 +0000

Hi,

I noticed in draft-ietf-netconf-restconf-04 and draft-ietf-netmod-yang-json-03 some inconsistencies

regarding reading (GET) and writing (PUT) list item:

ietf-netmod-yang-json-03, clearly says that list is serialized as array of objects,

but draft-ietf-netconf-restconf-04 showcases different serializations:

https://tools.ietf.org/html/draft-ietf-netconf-restconf-04#section-4.5

     PUT /restconf/data/example-jukebox:jukebox/
         library/artist=Foo%20Fighters/album=Wasting%20Light   HTTP/1.1
      Host: example.com
      Content-Type: application/yang.data+json

      {
        "example-jukebox:album" : {
          "name" : "Wasting Light",
          "genre" : "example-jukebox:alternative",
          "year" : 2011
        }
      }

Here list-item is serialized as object, no array around it (this is inconsistent with referenced ietf-netmod-yang-json-03)

The GET example for one list item (https://tools.ietf.org/html/draft-ietf-netconf-restconf-04#appendix-D.3.9) shows:

      GET /restconf/data/interfaces/interface=eth1 HTTP/1.1
      Host: example.com
      Accept: application/yang.data+json

   The server might respond as follows.

      HTTP/1.1 200 OK
      Date: Mon, 23 Apr 2012 17:01:00 GMT
      Server: example-server
      Content-Type: application/yang.data+json

      {
        "example:interface": [
          {
            "name" : "eth1",
            "status" : "up"
          }
        ]
      }

Here is serialized according ietf-netmod-yang-json-03.

This behaviour is confusing - since you it seems that data retrieved via GET to same URL should not be used for PUT to same URL.

This inconsistency was uncovered during bug analysis in Opendaylight (https://bugs.opendaylight.org/show_bug.cgi?id=2818) this was for 02 versions, but analysis shows it still

present in latest drafts.

AntonTkáčik
Head of Java office

Mlynské Nivy 56 / 821 05 Bratislava / Slovakia
+421 911 309 249 / [email-masked]
reception: +421 2 206 65 111 / www.pantheon.sk
[logo]