Skip to content

Commit 2234949

Browse files
committed
parser data UPDATE remove subtree parsing
1 parent c2b2d3d commit 2234949

7 files changed

Lines changed: 32 additions & 104 deletions

File tree

src/parser_data.h

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,32 +155,24 @@ struct ly_in;
155155
modified manually. If this flag is used incorrectly (for unordered data),
156156
the behavior is undefined and most functions executed with these
157157
data will not work correctly. */
158-
#define LYD_PARSE_SUBTREE 0x400000 /**< Parse only the first child item along with any descendants, but no
159-
siblings. This flag is not required when parsing data which do not
160-
start at the schema root; for that purpose, use lyd_parse_data's parent
161-
argument.
162-
Also, a new return value ::LY_ENOT is returned if there is a sibling
163-
subtree following in the input data. Note that if validation is requested,
164-
only the newly parsed subtree is validated. This might result in
165-
an invalid datastore content. */
166-
#define LYD_PARSE_WHEN_TRUE 0x800000 /**< Mark all the parsed nodes dependend on a when condition with the flag
158+
#define LYD_PARSE_WHEN_TRUE 0x400000 /**< Mark all the parsed nodes dependend on a when condition with the flag
167159
that means the condition was satisifed before. This allows for
168160
auto-deletion of these nodes during validation. */
169-
#define LYD_PARSE_NO_NEW 0x1000000 /**< Do not set ::LYD_NEW (non-validated node flag) for any nodes. Use
161+
#define LYD_PARSE_NO_NEW 0x800000 /**< Do not set ::LYD_NEW (non-validated node flag) for any nodes. Use
170162
when parsing validated data to skip some validation tasks and modify
171163
some validation behavior (auto-deletion of cases). */
172-
#define LYD_PARSE_STORE_ONLY 0x2010000 /**< Similar to ::LYD_PARSE_ONLY but even type value restrictions will not
164+
#define LYD_PARSE_STORE_ONLY 0x01010000 /**< Similar to ::LYD_PARSE_ONLY but even type value restrictions will not
173165
be checked (length, range, pattern, ...) and if a value can be stored,
174166
it is. Calling separate validation on these data always checks all the
175167
restrictions as well. */
176-
#define LYD_PARSE_JSON_NULL 0x4000000 /**< Allow using JSON empty value 'null' within JSON input, such nodes are
168+
#define LYD_PARSE_JSON_NULL 0x02000000 /**< Allow using JSON empty value 'null' within JSON input, such nodes are
177169
silently skipped and treated as non-existent. By default, such values
178170
are invalid. */
179-
#define LYD_PARSE_JSON_STRING_DATATYPES 0x8000000 /**< By default, JSON data values are expected to be in the correct
171+
#define LYD_PARSE_JSON_STRING_DATATYPES 0x04000000/**< By default, JSON data values are expected to be in the correct
180172
format according to RFC 7951 based on their type. Using this
181173
option the validation can be softened to accept boolean and
182174
number type values enclosed in quotes. */
183-
#define LYD_PARSE_ANYDATA_STRICT 0x10000000 /**< Apply strict parsing (::LYD_PARSE_STRICT) also to anydata
175+
#define LYD_PARSE_ANYDATA_STRICT 0x08000000 /**< Apply strict parsing (::LYD_PARSE_STRICT) also to anydata
184176
content. By default, unknown elements in anydata are parsed
185177
as opaque nodes. With this flag, an error is raised for any unknown
186178
elements within anydata/anyxml subtrees. */

src/parser_internal.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,11 @@ LY_ERR yin_parse_submodule(struct lysp_yin_ctx **yin_ctx, struct ly_ctx *ctx, st
245245
* @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions.
246246
* @param[in] int_opts Internal data parser options.
247247
* @param[out] parsed Set to add all the parsed siblings into.
248-
* @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
249248
* @param[out] lydctx_p Data parser context to finish validation.
250249
* @return LY_ERR value.
251250
*/
252251
LY_ERR lyd_parse_xml(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **first_p, struct ly_in *in,
253-
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, ly_bool *subtree_sibling,
254-
struct lyd_ctx **lydctx_p);
252+
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, struct lyd_ctx **lydctx_p);
255253

256254
/**
257255
* @brief Parse XML string as a NETCONF message.
@@ -265,7 +263,6 @@ LY_ERR lyd_parse_xml(const struct ly_ctx *ctx, struct lyd_node *parent, struct l
265263
* @param[in] data_type Expected NETCONF data type of the data.
266264
* @param[out] envp Individual parsed envelopes tree, may be returned possibly even on an error.
267265
* @param[out] parsed Set to add all the parsed siblings into.
268-
* @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
269266
* @param[out] lydctx_p Data parser context to finish validation.
270267
* @return LY_ERR value.
271268
*/
@@ -285,13 +282,12 @@ LY_ERR lyd_parse_xml_netconf(const struct ly_ctx *ctx, struct lyd_node *parent,
285282
* @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions.
286283
* @param[in] int_opts Internal data parser options.
287284
* @param[out] parsed Set to add all the parsed siblings into.
288-
* @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
289285
* @param[out] lydctx_p Optional data parser context to finish validation.
290286
* @return LY_ERR value.
291287
*/
292288
LY_ERR lyd_parse_json(const struct ly_ctx *ctx, struct lyd_node *parent, const struct lysc_node *schema,
293289
struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts,
294-
struct ly_set *parsed, ly_bool *subtree_sibling, struct lyd_ctx **lydctx_p);
290+
struct ly_set *parsed, struct lyd_ctx **lydctx_p);
295291

296292
/**
297293
* @brief Parse JSON string as a RESTCONF message.
@@ -305,7 +301,6 @@ LY_ERR lyd_parse_json(const struct ly_ctx *ctx, struct lyd_node *parent, const s
305301
* @param[in] data_type Expected RESTCONF data type of the data.
306302
* @param[out] envp Individual parsed envelopes tree, may be returned possibly even on an error.
307303
* @param[out] parsed Set to add all the parsed siblings into.
308-
* @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
309304
* @param[out] lydctx_p Data parser context to finish validation.
310305
* @return LY_ERR value.
311306
*/
@@ -324,13 +319,11 @@ LY_ERR lyd_parse_json_restconf(const struct ly_ctx *ctx, struct lyd_node *parent
324319
* @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions.
325320
* @param[in] int_opts Internal data parser options.
326321
* @param[out] parsed Set to add all the parsed siblings into.
327-
* @param[out] subtree_sibling Set if ::LYD_PARSE_SUBTREE is used and another subtree is following in @p in.
328322
* @param[out] lydctx_p Data parser context to finish validation.
329323
* @return LY_ERR value.
330324
*/
331325
LY_ERR lyd_parse_lyb(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **first_p, struct ly_in *in,
332-
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, ly_bool *subtree_sibling,
333-
struct lyd_ctx **lydctx_p);
326+
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, struct lyd_ctx **lydctx_p);
334327

335328
/**
336329
* @brief Validate eventTime date-and-time value.

src/parser_json.c

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,14 +1249,15 @@ lydjson_parse_any(struct lyd_json_ctx *lydctx, const struct lysc_node *snode, co
12491249
LOG_LOCSET(NULL, *node);
12501250
log_node = 1;
12511251

1252-
/* parse any data tree with correct options, first backup the current options and then make the parser
1253-
* process data as opaq nodes */
12541252
if (lydctx->parse_opts & LYD_PARSE_ANYDATA_STRICT) {
1253+
/* explicit strict data parsing */
12551254
lydctx->parse_opts |= LYD_PARSE_STRICT;
12561255
} else {
1256+
/* make the parser process data as opaq nodes */
12571257
lydctx->parse_opts &= ~LYD_PARSE_STRICT;
1258+
lydctx->parse_opts |= LYD_PARSE_OPAQ;
12581259
}
1259-
lydctx->parse_opts |= LYD_PARSE_OPAQ | (ext ? LYD_PARSE_ONLY : 0);
1260+
lydctx->parse_opts |= (ext ? LYD_PARSE_ONLY : 0);
12601261
lydctx->int_opts |= LYD_INTOPT_ANY | LYD_INTOPT_WITH_SIBLINGS;
12611262
lydctx->any_schema = snode;
12621263

@@ -1547,7 +1548,7 @@ lydjson_subtree_r(struct lyd_json_ctx *lydctx, struct lyd_node *parent, struct l
15471548
enum LYJSON_PARSER_STATUS status = lyjson_ctx_status(lydctx->jsonctx);
15481549
const char *name, *prefix = NULL, *expected = NULL;
15491550
size_t name_len, prefix_len = 0;
1550-
ly_bool is_meta = 0, parse_subtree;
1551+
ly_bool is_meta = 0;
15511552
const struct lysc_node *snode = NULL;
15521553
struct lysc_ext_instance *ext = NULL;
15531554
struct lyd_node *node = NULL, *attr_node = NULL;
@@ -1557,10 +1558,6 @@ lydjson_subtree_r(struct lyd_json_ctx *lydctx, struct lyd_node *parent, struct l
15571558
assert(parent || first_p);
15581559
assert((status == LYJSON_OBJECT) || (status == LYJSON_OBJECT_NEXT));
15591560

1560-
parse_subtree = lydctx->parse_opts & LYD_PARSE_SUBTREE ? 1 : 0;
1561-
/* all descendants should be parsed */
1562-
lydctx->parse_opts &= ~LYD_PARSE_SUBTREE;
1563-
15641561
r = lyjson_ctx_next(lydctx->jsonctx, &status);
15651562
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
15661563
if (status == LYJSON_OBJECT_CLOSED) {
@@ -1753,11 +1750,9 @@ lydjson_subtree_r(struct lyd_json_ctx *lydctx, struct lyd_node *parent, struct l
17531750
ly_set_add(parsed, node, 1, NULL);
17541751
}
17551752

1756-
if (!parse_subtree) {
1757-
/* move after the item(s) */
1758-
r = lyjson_ctx_next(lydctx->jsonctx, &status);
1759-
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
1760-
}
1753+
/* move after the item(s) */
1754+
r = lyjson_ctx_next(lydctx->jsonctx, &status);
1755+
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
17611756

17621757
/* success */
17631758
goto cleanup;
@@ -1935,7 +1930,7 @@ lyd_parse_json_bare_value(struct lyd_json_ctx *lydctx, enum LYJSON_PARSER_STATUS
19351930
LY_ERR
19361931
lyd_parse_json(const struct ly_ctx *ctx, struct lyd_node *parent, const struct lysc_node *schema,
19371932
struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts,
1938-
struct ly_set *parsed, ly_bool *subtree_sibling, struct lyd_ctx **lydctx_p)
1933+
struct ly_set *parsed, struct lyd_ctx **lydctx_p)
19391934
{
19401935
LY_ERR r, rc = LY_SUCCESS;
19411936
struct lyd_json_ctx *lydctx = NULL;
@@ -1984,19 +1979,6 @@ lyd_parse_json(const struct ly_ctx *ctx, struct lyd_node *parent, const struct l
19841979
r = lydjson_metadata_finish(lydctx, parent ? lyd_node_child_p(parent) : first_p);
19851980
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
19861981

1987-
if (parse_opts & LYD_PARSE_SUBTREE) {
1988-
/* check for a sibling object */
1989-
assert(subtree_sibling);
1990-
if (status == LYJSON_OBJECT_NEXT) {
1991-
*subtree_sibling = 1;
1992-
1993-
/* move to the next object */
1994-
ly_in_skip(lydctx->jsonctx->in, 1);
1995-
} else {
1996-
*subtree_sibling = 0;
1997-
}
1998-
}
1999-
20001982
cleanup:
20011983
/* there should be no unresolved types stored */
20021984
assert(!(parse_opts & LYD_PARSE_ONLY) || !lydctx || (!lydctx->node_types.count && !lydctx->meta_types.count &&
@@ -2100,7 +2082,6 @@ lyd_parse_json_restconf(const struct ly_ctx *ctx, struct lyd_node *parent, struc
21002082

21012083
assert((data_type == LYD_TYPE_RPC_RESTCONF) || (data_type == LYD_TYPE_NOTIF_RESTCONF) ||
21022084
(data_type == LYD_TYPE_REPLY_RESTCONF));
2103-
assert(!(parse_opts & LYD_PARSE_SUBTREE));
21042085

21052086
/* init context */
21062087
rc = lyd_parse_json_init(ctx, NULL, in, parse_opts, val_opts, NULL, &lydctx);

src/parser_lyb.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,26 +1750,19 @@ lyb_parse_header(struct lyd_lyb_ctx *lybctx)
17501750

17511751
LY_ERR
17521752
lyd_parse_lyb(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **first_p, struct ly_in *in,
1753-
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, ly_bool *subtree_sibling,
1754-
struct lyd_ctx **lydctx_p)
1753+
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, struct lyd_ctx **lydctx_p)
17551754
{
17561755
LY_ERR rc = LY_SUCCESS;
17571756
struct lyd_lyb_ctx *lybctx = NULL;
17581757

17591758
assert(!(parse_opts & ~LYD_PARSE_OPTS_MASK));
17601759
assert(!(val_opts & ~LYD_VALIDATE_OPTS_MASK));
17611760

1762-
LY_CHECK_ARG_RET(ctx, !(parse_opts & LYD_PARSE_SUBTREE), LY_EINVAL);
1763-
17641761
if (!(ctx->opts & LY_CTX_LYB_HASHES)) {
17651762
/* generate LYB hashes */
17661763
LY_CHECK_GOTO(rc = ly_ctx_set_options((struct ly_ctx *)ctx, LY_CTX_LYB_HASHES), cleanup);
17671764
}
17681765

1769-
if (subtree_sibling) {
1770-
*subtree_sibling = 0;
1771-
}
1772-
17731766
lybctx = calloc(1, sizeof *lybctx);
17741767
LY_CHECK_ERR_GOTO(!lybctx, LOGMEM(ctx); rc = LY_EMEM, cleanup);
17751768
lybctx->parse_ctx = calloc(1, sizeof *lybctx->parse_ctx);

src/parser_xml.c

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,20 +1020,13 @@ lydxml_subtree_r(struct lyd_xml_ctx *lydctx, struct lyd_node *parent, struct lyd
10201020
struct lyd_attr *attr = NULL;
10211021
const struct lysc_node *snode = NULL;
10221022
struct lysc_ext_instance *ext = NULL;
1023-
uint32_t orig_parse_opts;
10241023
struct lyd_node *node = NULL;
1025-
ly_bool parse_subtree;
10261024

10271025
assert(parent || first_p);
10281026

10291027
xmlctx = lydctx->xmlctx;
10301028
ctx = xmlctx->ctx;
10311029

1032-
parse_subtree = lydctx->parse_opts & LYD_PARSE_SUBTREE ? 1 : 0;
1033-
/* all descendants should be parsed */
1034-
lydctx->parse_opts &= ~LYD_PARSE_SUBTREE;
1035-
orig_parse_opts = lydctx->parse_opts;
1036-
10371030
assert(xmlctx->status == LYXML_ELEMENT);
10381031

10391032
/* remember element prefix and name */
@@ -1131,10 +1124,8 @@ lydxml_subtree_r(struct lyd_xml_ctx *lydctx, struct lyd_node *parent, struct lyd
11311124

11321125
/* parser next */
11331126
assert(xmlctx->status == LYXML_ELEM_CLOSE);
1134-
if (!parse_subtree) {
1135-
r = lyxml_ctx_next(xmlctx);
1136-
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
1137-
}
1127+
r = lyxml_ctx_next(xmlctx);
1128+
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
11381129

11391130
LY_CHECK_GOTO(!node, cleanup);
11401131

@@ -1153,7 +1144,6 @@ lydxml_subtree_r(struct lyd_xml_ctx *lydctx, struct lyd_node *parent, struct lyd
11531144
}
11541145

11551146
cleanup:
1156-
lydctx->parse_opts = orig_parse_opts;
11571147
lyd_free_meta_siblings(meta);
11581148
lyd_free_attr_siblings(ctx, attr);
11591149
return rc;
@@ -1239,14 +1229,12 @@ lydxml_envelope(struct lyxml_ctx *xmlctx, const char *name, const char *uri, ly_
12391229

12401230
LY_ERR
12411231
lyd_parse_xml(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **first_p, struct ly_in *in,
1242-
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, ly_bool *subtree_sibling,
1243-
struct lyd_ctx **lydctx_p)
1232+
uint32_t parse_opts, uint32_t val_opts, uint32_t int_opts, struct ly_set *parsed, struct lyd_ctx **lydctx_p)
12441233
{
12451234
LY_ERR r, rc = LY_SUCCESS;
12461235
struct lyd_xml_ctx *lydctx;
12471236
ly_bool parsed_data_nodes = 0, close_elem = 0;
12481237
struct lyd_node *act = NULL;
1249-
enum LYXML_PARSER_STATUS status;
12501238

12511239
assert(ctx && in && lydctx_p);
12521240
assert(!(parse_opts & ~LYD_PARSE_OPTS_MASK));
@@ -1314,16 +1302,6 @@ lyd_parse_xml(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node
13141302
lydctx->op_node = NULL;
13151303
}
13161304

1317-
if (parse_opts & LYD_PARSE_SUBTREE) {
1318-
/* check for a sibling element */
1319-
assert(subtree_sibling);
1320-
if (!lyxml_ctx_peek(lydctx->xmlctx, &status) && (status == LYXML_ELEMENT)) {
1321-
*subtree_sibling = 1;
1322-
} else {
1323-
*subtree_sibling = 0;
1324-
}
1325-
}
1326-
13271305
cleanup:
13281306
/* there should be no unres stored if validation should be skipped */
13291307
assert(!(parse_opts & LYD_PARSE_ONLY) || (!lydctx->node_types.count && !lydctx->meta_types.count &&
@@ -1494,7 +1472,6 @@ lyd_parse_xml_netconf(const struct ly_ctx *ctx, struct lyd_node *parent, struct
14941472
assert(ctx && in && lydctx_p);
14951473
assert(!(parse_opts & ~LYD_PARSE_OPTS_MASK));
14961474
assert(!(val_opts & ~LYD_VALIDATE_OPTS_MASK));
1497-
assert(!(parse_opts & LYD_PARSE_SUBTREE));
14981475

14991476
/* init context */
15001477
lydctx = calloc(1, sizeof *lydctx);

src/tree_data.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ lyd_parse(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **f
106106
struct ly_set parsed = {0};
107107
uint32_t i, int_opts = 0;
108108
const struct ly_err_item *eitem;
109-
ly_bool subtree_sibling = 0;
110109

111110
assert(ctx && (parent || first_p));
112111

@@ -119,23 +118,18 @@ lyd_parse(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **f
119118
in->func_start = in->current;
120119

121120
/* set internal options */
122-
if (!(parse_opts & LYD_PARSE_SUBTREE)) {
123-
int_opts = LYD_INTOPT_WITH_SIBLINGS;
124-
}
121+
int_opts = LYD_INTOPT_WITH_SIBLINGS;
125122

126123
/* parse the data */
127124
switch (format) {
128125
case LYD_XML:
129-
r = lyd_parse_xml(ctx, parent, first_p, in, parse_opts, val_opts, int_opts, &parsed,
130-
&subtree_sibling, &lydctx);
126+
r = lyd_parse_xml(ctx, parent, first_p, in, parse_opts, val_opts, int_opts, &parsed, &lydctx);
131127
break;
132128
case LYD_JSON:
133-
r = lyd_parse_json(ctx, parent, NULL, first_p, in, parse_opts, val_opts, int_opts, &parsed,
134-
&subtree_sibling, &lydctx);
129+
r = lyd_parse_json(ctx, parent, NULL, first_p, in, parse_opts, val_opts, int_opts, &parsed, &lydctx);
135130
break;
136131
case LYD_LYB:
137-
r = lyd_parse_lyb(ctx, parent, first_p, in, parse_opts, val_opts, int_opts, &parsed,
138-
&subtree_sibling, &lydctx);
132+
r = lyd_parse_lyb(ctx, parent, first_p, in, parse_opts, val_opts, int_opts, &parsed, &lydctx);
139133
break;
140134
case LYD_UNKNOWN:
141135
LOGARG(ctx, format);
@@ -192,8 +186,6 @@ lyd_parse(const struct ly_ctx *ctx, struct lyd_node *parent, struct lyd_node **f
192186
lyd_free_all(*first_p);
193187
*first_p = NULL;
194188
}
195-
} else if (subtree_sibling) {
196-
rc = LY_ENOT;
197189
}
198190
ly_set_erase(&parsed, NULL);
199191
return rc;
@@ -304,7 +296,7 @@ lyd_parse_value_fragment(const struct ly_ctx *ctx, const char *path, struct ly_i
304296

305297
/* parse the json value */
306298
LY_CHECK_GOTO(ret = lyd_parse_json(ctx, new_last_parent, new_node_schema, new_last_parent ? NULL : &new_top_parent,
307-
in, parse_options, validate_options, 0, NULL, NULL, NULL), cleanup);
299+
in, parse_options, validate_options, 0, NULL, NULL), cleanup);
308300

309301
/* when setting keys they have to have a correct value (same as in the path) */
310302
if (lysc_is_key(new_node_schema)) {
@@ -457,13 +449,13 @@ lyd_parse_op(const struct ly_ctx *ctx, struct lyd_node *parent, struct ly_in *in
457449
/* parse the data */
458450
switch (format) {
459451
case LYD_XML:
460-
rc = lyd_parse_xml(ctx, parent, &first, in, parse_options, val_opts, int_opts, &parsed, NULL, &lydctx);
452+
rc = lyd_parse_xml(ctx, parent, &first, in, parse_options, val_opts, int_opts, &parsed, &lydctx);
461453
break;
462454
case LYD_JSON:
463-
rc = lyd_parse_json(ctx, parent, NULL, &first, in, parse_options, val_opts, int_opts, &parsed, NULL, &lydctx);
455+
rc = lyd_parse_json(ctx, parent, NULL, &first, in, parse_options, val_opts, int_opts, &parsed, &lydctx);
464456
break;
465457
case LYD_LYB:
466-
rc = lyd_parse_lyb(ctx, parent, &first, in, parse_options, val_opts, int_opts, &parsed, NULL, &lydctx);
458+
rc = lyd_parse_lyb(ctx, parent, &first, in, parse_options, val_opts, int_opts, &parsed, &lydctx);
467459
break;
468460
case LYD_UNKNOWN:
469461
LOGARG(ctx, format);

0 commit comments

Comments
 (0)