[NETCONF-198] PATCH success "ok" field has wrong JSON value Created: 17/May/16  Updated: 15/Mar/19  Resolved: 05/Aug/16

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

Type: Bug
Reporter: Vratko Polak 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: 5898

 Description   

Both "ok" leafs in the PATCH output are of type empty.
https://tools.ietf.org/html/draft-ietf-netconf-yang-patch-08#section-3

The value should be written either as [null] or as {} (depending on Restconf draft version). But currently the value is written as null.

$ curl -u'admin:admin' -X PATCH -H "Content-Type:application/yang.patch+json" -d '{"ietf-restconf:yang-patch":{"patch-id":"0","edit":[{"edit-id":"0","operation":"replace","target":"/car:car-entry[car:id='"'"'0'"'"']","value":{"car:car-entry":[

{"id":"0"}

]}}]}' 127.0.0.1:8181/restconf/config/car:cars ;echo

{"ietf-yang-patch:yang-patch-status":

{"patch-id":"0","ok":null}

}



 Comments   
Comment by Vratko Polak [ 19/May/16 ]

Oh, I have misread the fifth item before [0].
{} is only for empty containers, value of empty type should be always encoded as [null] as specified in [1].

[0] https://tools.ietf.org/html/draft-ietf-netconf-restconf-11#appendix-A.3
[1] https://tools.ietf.org/html/draft-ietf-netmod-yang-json-10#section-6.9

Comment by Ivan Hrasko [ 30/Jun/16 ]

Patch:
https://git.opendaylight.org/gerrit/#/c/41123/

Comment by Ivan Hrasko [ 11/Jul/16 ]

Patch https://git.opendaylight.org/gerrit/#/c/41123/ has been merged to Be

Comment by Ivan Hrasko [ 18/Jul/16 ]

Needs to be adapted to Boron

Comment by Ivan Hrasko [ 27/Jul/16 ]

Cherry pick to boron old Restconf:
https://git.opendaylight.org/gerrit/#/c/42456/8

Comment by Ivan Hrasko [ 29/Jul/16 ]

Cherry pick merged to Boron.

Comment by Ivan Hrasko [ 05/Aug/16 ]

patch for new restconf has been merged to master:
https://git.opendaylight.org/gerrit/#/c/41833/

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