-
Bug
-
Resolution: Done
-
Medium
-
3.0.0, 3.0.1, 3.0.2
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" } } ] } }