⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

lyd_parse_data_path parse options #2477

@yoousra

Description

@yoousra

Hi,

Used versions:
libyang-3.13.6
sysrepo-3.7.11

I'm using lyd_parse_data_path(const struct ly_ctx *ctx, const char *path, LYD_FORMAT format, uint32_t parse_options, uint32_t validate_options, struct lyd_node **tree) to parse an xml file and validate that its content is conformed to the yang data tree.

I have something like this:

sr_connect(0, &sr_conn);
struct ly_ctx* ctx = sr_acquire_context(sr_conn);
lyd_parse_data_path(ctx, my_xml_file, LYD_XML, parse_options=**LYD_PARSE_STRICT**, LYD_VALIDATE_MULTI_ERROR, &output);

But my need is also to return an error when there's a module in the xml that is not installed in sysrepo.
I'm using LYD_PARSE_STRICT but it doesn't work for this type of verification. Is there a way to verify this?

Thank you for your reply!

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:questionIssue is actually a question.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions