Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The lyd_parse_data_mem function cannot process data other than invalid data. #2330

Open
sicongPang opened this issue Dec 24, 2024 · 0 comments

Comments

@sicongPang
Copy link

sicongPang commented Dec 24, 2024

module:
container testsdk {
container TsdkTypeInners {
list TsdkTypeInner {
key "TestIndex TestName";
config true;
mo:global-max-elements "1000000";
leaf TestIndex {
type uint32 {
range "0..4294967295";
}
mandatory true;
mo:indexAssignMode "INC";
mo:isIndexField "true";
}
leaf TestName {
type string {
length "0..50";
}
mandatory true;
}
leaf TestString2 {
type string {
length "0..20";
}
mandatory false;
}
}
}

When invalid data is constructed and the lyd_parse_data_mem function is invoked for parsing, subsequent data parsing is ignored:

image

LY_ERR ret = lyd_parse_data_mem(pstLocal->stServer.pstYang, xmlStr, LYD_XML, LYD_PARSE_ONLY | LYD_PARSE_NO_STATE,
    LYD_VALIDATE_PRESENT | LYD_VALIDATE_NO_STATE, &pstTree1);

Is this as expected? Which of the following options can be used to skip only invalid data to ensure that subsequent valid data can be parsed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant