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

Fail to process PATCH to data root with a top-level container as target

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 4.0.0, 3.0.3
    • 3.0.0, 3.0.1, 3.0.2
    • restconf-nb

      Controller fails to process a PATCH request to the data root with a top-level container as target.

      For example, with the following YANG model:

      module foo {
          namespace "urn:foo";
          prefix orig;
      
          container foo {
              leaf bar {
                  type string;
              }
          }
      }
      

      The following PATCH request fails:

      PATCH /rests/data
      {
          "ietf-yang-patch:yang-patch": {
              "patch-id": "patch-1",
              "edit": [
                  {
                      "edit-id": "edit1",
                      "operation": "merge",
                      "target": "/foo:foo",
                      "value": {
                          "foo:foo": {
                              "bar": "apple"
                          }
                      }
                  }
              ]
          }
      }
      

      with the following error:

      {
          "errors": {
              "error": [
                  {
                      "error-tag": "malformed-message",
                      "error-info": "Cannot execute on empty stack",
                      "error-message": "Error parsing json input: Cannot execute on empty stack",
                      "error-type": "protocol"
                  }
              ]
          }
      }
      

      The following equivalent requests work:

      PATCH /rests/data/foo:foo
      {
          "ietf-yang-patch:yang-patch": {
              "patch-id": "patch-1",
              "edit": [
                  {
                      "edit-id": "edit1",
                      "operation": "merge",
                      "target": "/",
                      "value": {
                          "foo:foo": {
                              "bar": "apple"
                          }
                      }
                  }
              ]
          }
      }
      
      PATCH /rests/data
      {
          "ietf-yang-patch:yang-patch": {
              "patch-id": "patch-1",
              "edit": [
                  {
                      "edit-id": "edit1",
                      "operation": "merge",
                      "target": "/foo:foo/bar",
                      "value": {
                          "bar": "apple"
                      }
                  }
              ]
          }
      }
      

            sangwookha Sangwook Ha
            sangwookha Sangwook Ha
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: