Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-834

Duplicated list key in RESTCONF payload does not produce ERROR

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Medium
    • Resolution: Unresolved
    • None
    • None
    • codecs
    • None

    Description

      Current yang parser does not throw any error if user enters duplicated list key in config DS. Moreover the yang parser merges the overlapping data without notifying the user/application about the original data modification.

      To reproduce:

      1) Install openflow feature:

      feature:install odl-openflowplugin-flow-services-rest

      2) Send following request with duplicated key (id) and check controller does not reject the request:

      POST http://192.168.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0
      {
            "flow": [
              {
                "id": "1",
                "match": {
                  "ethernet-match": {
                    "ethernet-type": {
                      "type": 2048
                    }
                  },
                  "ipv4-destination": "10.0.10.0/24"
                },
                "priority": 2,
                "table_id": 0
              },
              {
                "id": "1",
                "match": {
                  "ethernet-match": {
                    "ethernet-type": {
                      "type": 2048
                    }
                  },
                  "ipv4-destination": "10.0.20.0/24"
                },
                "priority": 2,
                "table_id": 0
              }
            ]
      }
      

      3) Check parser has merged 2 list objects in one:

      GET http://192.168.0.1:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0
      {
          "flow-node-inventory:table": [
              {
                  "id": 0,
                  "flow": [
                      {
                          "id": "1",
                          "match": {
                              "ethernet-match": {
                                  "ethernet-type": {
                                      "type": 2048
                                  }
                              },
                              "ipv4-destination": "10.0.10.0/24"
                          },
                          "priority": 2,
                          "table_id": 0
                      }
                  ]
              }
          ]
      } 
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            ecelgp Luis Gomez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: