Fixed: [Returning a string while Querying leaf-list for single entry](https://github.com/clicon/clixon/issues/326)
This commit is contained in:
parent
7065d6f760
commit
0c81b66ef3
6 changed files with 66 additions and 8 deletions
|
|
@ -1062,15 +1062,29 @@ xml2json_cbuf(cbuf *cb,
|
|||
cxobj *x,
|
||||
int pretty)
|
||||
{
|
||||
int retval = 1;
|
||||
int level = 0;
|
||||
|
||||
int retval = 1;
|
||||
int level = 0;
|
||||
yang_stmt *y;
|
||||
enum array_element_type arraytype = NO_ARRAY;
|
||||
|
||||
cprintf(cb, "%*s{%s",
|
||||
pretty?level*JSON_INDENT:0,"",
|
||||
pretty?"\n":"");
|
||||
|
||||
if ((y = xml_spec(x)) != NULL){
|
||||
switch (yang_keyword_get(y)){
|
||||
case Y_LEAF_LIST:
|
||||
case Y_LIST:
|
||||
arraytype = SINGLE_ARRAY;
|
||||
break;
|
||||
default:
|
||||
arraytype = NO_ARRAY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (xml2json1_cbuf(cb,
|
||||
x,
|
||||
NO_ARRAY,
|
||||
arraytype,
|
||||
level+1,
|
||||
pretty,
|
||||
0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue