Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-752

When saving over data which already exists the JSON response contains forward slash.

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Won't Do
    • Helium
    • None
    • restconf
    • None
    • Operating System: Linux
      Platform: PC

    • 1661

    Description

      I am raising this as a bug because the presence or (lack of) of '/' leads to inconsistencies in describing the expected response.

      TEST ENV
      org.opendaylight.controller.version = 0.1
      org.opendaylight.controller.build.scm.version = 78fec1c1c5a3720bd48d1044703824626f08b5d9
      org.opendaylight.controller.build.user = jenkins-controller
      org.opendaylight.controller.build.workspace = **********
      org.opendaylight.controller.build.timestamp = 1409283738738
      org.opendaylight.controller.build.machine = **********

      I tried to save data which already exists in datastore in JSON format to a location behind /config root. I then tried to invoke an error response by saving the same data again. No special config was used.

      Steps

      method is: post
      uri is: /restconf/config/opendaylight-inventory:nodes
      headers is:

      {'content-type': 'application/json', 'accept': 'application/json'}

      data is: {
      "opendaylight-inventory:node":[

      { "id":"id2" }

      ]
      }
      expected_status is: 204

      and then repeat

      method is: post
      uri is: /restconf/config/opendaylight-inventory:nodes
      headers is:

      {'content-type': 'application/json', 'accept': 'application/json'}

      data is: {
      "opendaylight-inventory:node":[

      { "id":"id2" }

      ]
      }
      expected_status is: 409
      expected response is

      {
      "errors": {
      "error": [
      {
      "error-message": "Data already exists for path: (urn:opendaylight:inventory?revision=2013-08-19)nodes(urn:opendaylight:inventory?revision=2013-08-19)node[

      {(urn:opendaylight:inventory?revision=2013-08-19)id=id2}

      ]",
      "error-tag": "data-exists",
      "error-type": "protocol"
      }
      ]
      }
      }

      ACTUAL RESPONSE

      {
      "errors": {
      "error": [
      {
      "error-type": "protocol",
      "error-tag": "data-exists",
      "error-message": "Data already exists for path: /(urn:opendaylight:inventory?revision=2013-08-19)nodes/node/node[

      {(urn:opendaylight:inventory?revision=2013-08-19)id=id2}

      ]"
      }
      ]
      }
      }

      NOTES
      The path on the "error message" key also looks wrong. nodes is duplicated.

      Attachments

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

        Activity

          People

            tony.tkacik@gmail.com Tony Tkacik
            ricjhill@gmail.com RichardHill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: