Details
-
Bug
-
Status: Resolved
-
Medium
-
Resolution: Done
-
3.0.0, 3.0.1, 3.0.2
Description
Controller fails to process a PATCH request to the data root with a top-level container as target.
For example, with the following YANG model:
module foo {
namespace "urn:foo";
prefix orig;
container foo {
leaf bar {
type string;
}
}
}
The following PATCH request fails:
PATCH /rests/data
{
"ietf-yang-patch:yang-patch": {
"patch-id": "patch-1",
"edit": [
{
"edit-id": "edit1",
"operation": "merge",
"target": "/foo:foo",
"value": {
"foo:foo": {
"bar": "apple"
}
}
}
]
}
}
with the following error:
{
"errors": {
"error": [
{
"error-tag": "malformed-message",
"error-info": "Cannot execute on empty stack",
"error-message": "Error parsing json input: Cannot execute on empty stack",
"error-type": "protocol"
}
]
}
}
The following equivalent requests work:
PATCH /rests/data/foo:foo
{
"ietf-yang-patch:yang-patch": {
"patch-id": "patch-1",
"edit": [
{
"edit-id": "edit1",
"operation": "merge",
"target": "/",
"value": {
"foo:foo": {
"bar": "apple"
}
}
}
]
}
}
PATCH /rests/data
{
"ietf-yang-patch:yang-patch": {
"patch-id": "patch-1",
"edit": [
{
"edit-id": "edit1",
"operation": "merge",
"target": "/foo:foo/bar",
"value": {
"bar": "apple"
}
}
]
}
}
Attachments
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 100985,1 | Fix PATCH request issue with top-level container as target | 3.0.x | netconf | Status: MERGED | +2 | +1 |
| 101003,5 | Fix PATCH request issue with top-level container as target | master | netconf | Status: MERGED | +2 | +1 |