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

Data sent via yang-patch is validated in a different way than PUT / POST

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Medium Medium
    • 2.0.11
    • None
    • restconf-nb
    • None

      Data that is sent via yang-patch is validated in a different way than sending it via simple PUT/POST request:

      {    
           "ietf-restconf:yang-patch": {        
               "patch-id": "patch-1",        
               "edit": [            
                   {                
                     "edit-id": "edit1",                
                     "operation": "replace",                
                     "target": "/",                
                     "value": {                    
                         <config>   
                     }            
                    }        
                ]    
            }
      }  

      Opendaylight returns following error when data is sent via yang-patch:

      {
          "errors": {
              "error": [
                  {
                      "error-type": "protocol",
                      "error-tag": "malformed-message",
                      "error-message": "Error parsing json input: Expected BEGIN_OBJECT but was NUMBER at line 22 column 63 path $.ietf-restconf:yang-patch.edit[0].value.<...>",
                      "error-info": "Expected BEGIN_OBJECT but was NUMBER at line 22 column 63 path $.ietf-restconf:yang-patch.edit[0].value.data[0].<...>"
                  }
              ]
          }
      } 

      For yang-patch all NUMBERS / BOOLEAN-values needs to be converted in order that it is acceppted from Opendaylight.

      "Simple" PUT / POST request accepts different types of values (number / boolean).

            Unassigned Unassigned
            lenapeuk Lena Peuker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: