Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-1152

RESTCONF DataTreeChange notifications use incorrect format

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Highest Highest
    • 7.0.0
    • 2.0.17, 3.0.9, 5.0.7, 4.0.8, 6.0.2
    • restconf-nb

      There are two distinct problems here. A JSON notification is encoded as:

      {
        "urn-ietf-params-xml-ns-netconf-notification-1.0:notification": {
          "urn-opendaylight-params-xml-ns-yang-controller-md-sal-remote:data-changed-notification": {
            "data-change-event": [
              {
                "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:name",
                "data": {
                  "instance-identifier-patch-module:name": "Althea"
                },
                "operation": "updated"
              },
              {
                "path": "/instance-identifier-patch-module:patch-cont/instance-identifier-patch-module:my-list1/instance-identifier-patch-module:my-list1[instance-identifier-patch-module:name='Althea']/instance-identifier-patch-module:my-leaf12",
                "data": {
                  "instance-identifier-patch-module:my-leaf12": "Bertha"
                },
                "operation": "created"
              },
              {
              "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:patch-choice1/augment-instance-identifier-patch-module:case-leaf1",
              "data": {
                "augment-iip-module:case-leaf1": "ChoiceUpdate"
              },
                "operation": "updated"
              },
              {
                "path": "/instance-identifier-patch-module:patch-cont/augment-instance-identifier-patch-module:leaf1",
                "data": {
                  "augment-iip-module:leaf1": "AugmentLeaf"
                },
                "operation": "updated"
              }
            ]
          },
          "event-time": "2022-02-18T18:04:25.214583+01:00"
        }
      }
      

      The first issue is that the top two elements have incorrect namespaces:

      The second problem, shared with XML encoding, is how 'path' element's name is encoded. This is using AbstractWebsocketSerializer.convertPath(), which is ... funky to say the least. It pretends to use the JSON encoding, but does not use module names but XMLNamespaces ... and changes them by replacing all ':'s with '-'s. Just to pick on it a bit more, it does not eliminate unneeded namespace references.

      All of this needs to be fixed up, but means we are changing our external interface, so the fix should be only delivered to netconf-7.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: