* Fixed: [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303)

This commit is contained in:
Olof hagsand 2022-02-17 18:42:37 +01:00
parent 4631b02e00
commit bf00fdf2c1
12 changed files with 57 additions and 11 deletions

View file

@ -784,6 +784,11 @@ xml2json1_cbuf(cbuf *cb,
if (ys_real_module(ys, &ymod) < 0)
goto done;
modname = yang_argument_get(ymod);
/* Special case for ietf-netconf -> ietf-restconf translation
* A special case is for return data on the form {"data":...}
*/
if (strcmp(modname, "ietf-netconf")==0)
modname = "ietf-restconf";
if (modname0 && strcmp(modname, modname0) == 0)
modname=NULL;
else
@ -1065,7 +1070,6 @@ xml2json_cbuf(cbuf *cb,
pretty?"\n":"",
pretty?level*JSON_INDENT:0,"",
pretty?"\n":"");
retval = 0;
done:
return retval;