[NETCONF-374] Json HTTP PATCH: Problem parsing simple leaf value Created: 15/Mar/17  Updated: 15/Mar/19  Resolved: 16/Mar/17

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Ivan Hrasko Assignee: Ivan Hrasko
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 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".



 Comments   
Comment by Ivan Hrasko [ 16/Mar/17 ]

cherry pick to stable/boron: https://git.opendaylight.org/gerrit/#/c/53395/

Generated at Wed Feb 07 20:14:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.