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

Json HTTP PATCH: Problem parsing simple leaf value

    XMLWordPrintable

Details

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

    • 7987

    Description

      Yang model as below:
      container configuration{
      container system{
      leaf host-name {
      description "Hostname for this router";
      type string

      { length "1 .. 255"; junos:posix-pattern "^[[:alnum:]._-]+$"; junos:pattern-message "Must be a string of alphanumericals, dashes or underscores"; }

      }
      }
      }

      When I tried to replace the "host-name" with following request:
      PATCH http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/jMX/yang-ext:mount/configuration:configuration/
      Payload:
      {
      "ietf-yang-patch:yang-patch": {
      "patch-id": "ch-hn-1",
      "comment": "Change Hostname-1",
      "edit": [
      {
      "edit-id": "1",
      "operation": "replace",
      "target": "/configuration:system/configuration:host-name",
      "value":

      { "host-name":"abc" }

      }
      ]
      }
      }

      The respond returns an error "Error parsing json input: Expected BEGIN_OBJECT but was STRING at line 11 column 24 path $.ietf-yang-patch:yang-patch.edit[0].value.host-name".

      Attachments

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

        Activity

          People

            ivan.hrasko@pantheon.tech Ivan Hrasko
            ivan.hrasko@pantheon.tech Ivan Hrasko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: