Added restconf/operations get, see RFC8040 Sec 3.3.2:
This commit is contained in:
Olof hagsand 2018-03-04 21:24:38 +01:00
parent 6a22524d38
commit 990700b68d
16 changed files with 355 additions and 93 deletions

View file

@ -304,10 +304,12 @@ xml2json1_cbuf(cbuf *cb,
break;
}
case NO_ARRAY:
if (!flat)
cprintf(cb, "%*s\"%s\": ",
pretty?(level*JSON_INDENT):0, "",
xml_name(x));
if (!flat){
cprintf(cb, "%*s\"", pretty?(level*JSON_INDENT):0, "");
if (xml_namespace(x))
cprintf(cb, "%s:", xml_namespace(x));
cprintf(cb, "%s\": ", xml_name(x));
}
switch (childt){
case NULL_CHILD:
cprintf(cb, "null");
@ -323,9 +325,10 @@ xml2json1_cbuf(cbuf *cb,
break;
case FIRST_ARRAY:
case SINGLE_ARRAY:
cprintf(cb, "%*s\"%s\": ",
pretty?(level*JSON_INDENT):0, "",
xml_name(x));
cprintf(cb, "%*s\"", pretty?(level*JSON_INDENT):0, "");
if (xml_namespace(x))
cprintf(cb, "%s:", xml_namespace(x));
cprintf(cb, "%s\": ", xml_name(x));
level++;
cprintf(cb, "[%s%*s",
pretty?"\n":"",