Fixed: [CLI Show config JSON with multiple top-level elements is broken](https://github.com/clicon/clixon/issues/381)

C API: Added skiptop parameter to xml2json_vec
This commit is contained in:
Olof hagsand 2022-10-28 15:13:41 +02:00
parent 097aeb0320
commit 83f71529d7
8 changed files with 94 additions and 40 deletions

View file

@ -283,7 +283,7 @@ api_data_get2(clicon_handle h,
/* In: <x xmlns="urn:example:clixon">0</x>
* Out: {"example:x": {"0"}}
*/
if (xml2json_cbuf_vec(cbx, xvec, xlen, pretty) < 0)
if (xml2json_cbuf_vec(cbx, xvec, xlen, pretty, 0) < 0)
goto done;
break;
default:
@ -546,7 +546,7 @@ api_data_pagination(clicon_handle h,
goto done;
break;
case YANG_DATA_JSON:
if (xml2json_cbuf_vec(cbx, xvec, xlen, pretty) < 0)
if (xml2json_cbuf_vec(cbx, xvec, xlen, pretty, 0) < 0)
goto done;
break;
default: