[NETCONF-1152] RESTCONF DataTreeChange notifications use incorrect format Created: 07/Sep/23  Updated: 12/Sep/23  Resolved: 12/Sep/23

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: 2.0.17, 3.0.9, 5.0.7, 4.0.8, 6.0.2
Fix Version/s: 7.0.0

Type: Bug Priority: Highest
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.


Generated at Wed Feb 07 20:16:48 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.