Skip to content

Implicit defaults without validation #2437

Open

Description

@steweg

Hi,

I am currently troubleshooting some issue related the data node creation with implicit default. My working assumption was that adding implicit defaults doesn't trigger any special validations on the rest of the data tree. If needed it will trigger validation of these default nodes only.

But my assumption is apparently wrong. I was not yet able to determine the root-cause and prepare a patch, but I have found a workaround within my application to simply postpone adding of implicit defaults to later stages when the validation step is working correctly (I need to properly perform linking of newly created data with the rest of the existing data tree prior I am adding implicit defaults).

My question to you is whether there was some intention within libyang that adding implicit nodes will revalidate the rest of data tree as well or not? If not, then this can be considered as a kind of bug. If yes, then it might be worth considering adding new option into the API calls, which will allow caller to decide whether or not to perform validation (kind of PARSE_ONLY or STORE_ONLY like flag)

Thanks

Activity

  1. michalvasko commented on Oct 9, 2025

    @michalvasko
    Member

    You would have to include more details about the use-case, but adding implicit nodes should definitely not trigger validation of the whole data tree. There are when conditions evaluated on these new nodes, I think, but probably nothing else.

  2. steweg commented on Oct 9, 2025

    @steweg
    ContributorAuthor

    Hi, I am still not able to get the root-cause of my issue, as I was getting errors related to leafref resolutions, even though I definitely doesn't have any leafref with default setting within model. So it doesn't make sense to me. But I am suspecting that this might not be libyang bug, but rather something with my usage, which somehow resulted in this error.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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