Skip to content

Commit cdb16a1

Browse files
committed
json parser BUGFIX list/leaf-list in input/output do not have to be ordered
1 parent d20b904 commit cdb16a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/parser_json.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ json_get_value(struct lyd_node_leaf_list *leaf, struct lyd_node **first_sibling,
518518
len += skip_ws(&data[len]);
519519
if (data[len] == ',') {
520520
/* various validation checks */
521-
if (lyv_data_context((struct lyd_node*)leaf, options, unres) ||
521+
if (lyv_data_context((struct lyd_node*)leaf, options | LYD_OPT_TRUSTED, unres) ||
522522
lyv_data_content((struct lyd_node*)leaf, options, unres) ||
523523
lyv_multicases((struct lyd_node*)leaf, NULL, first_sibling, 0, NULL)) {
524524
return 0;
@@ -1213,7 +1213,7 @@ json_parse_data(struct ly_ctx *ctx, const char *data, const struct lys_node *sch
12131213

12141214
if (data[len] == ',') {
12151215
/* various validation checks */
1216-
if (lyv_data_context(list, options, unres) ||
1216+
if (lyv_data_context(list, options | LYD_OPT_TRUSTED, unres) ||
12171217
lyv_data_content(list, options, unres) ||
12181218
lyv_multicases(list, NULL, prev ? &first_sibling : NULL, 0, NULL)) {
12191219
goto error;

0 commit comments

Comments
 (0)