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

Deleting non existing data using PATCH should return 404

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    • 8878

    Description

      According to rfc8072, section 2.5., delete operation should return error when the data does not exist.
      Steps to reproduce:
      feature:install odl-restconf odl-clustering-test-app

      Run curl:
      curl -X PATCH --user admin:admin ${ODL_HOST}:8181/restconf/config/car:cars -v -H "Content-Type: application/yang.patch+json" -H "Accept: application/yang.patch-status+json" -d '
      {
      "ietf-restconf:yang-patch" : {
      "patch-id" : "0",
      "edit" : [

      { "edit-id" : "edit2", "operation" : "delete", "target" : "/car:car-entry[car:id=\"1\"]" }

      ]
      }
      }
      '

      With no data in car:cars, returns 200 but outputs:
      {"ietf-yang-patch:yang-patch-status":{"patch-id":"0","errors":{"error":[

      {"error-type":"application","error-tag":"operation-failed","error-message":"Data did not pass validation."}

      ]},"edit-status":{"edit":[

      {"edit-id":"edit2","ok":[null]}

      ]}}}

      This is probably the same issue reported as NETCONF-429 .

      However adding a car:
      curl -v --user admin:admin $ODL_HOST:8181/restconf/config/car:cars/ -H "Content-Type: application/yang.data+json" -X PUT -d '
      { "cars" :
      {"car-entry": [

      { "id": "1", "category": "coupe", "model": "mustang", "manufacturer": "ford", "year": "2013" }

      ]
      }
      }
      '

      And then executing PATCH delete operation multiple times will always result in status code 200 and output:
      {"ietf-yang-patch:yang-patch-status":{"patch-id":"0","ok":[null]}}

      Expected behavior:
      According to the RFC the first delete operation should succeed with 200, all subsequent delete operations must fail with status code 404.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              tolvecky@frinx.io Tomas Olvecky
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: