Skip to content

Deviate add of extension-only statement on a notification drops its data children #2543

Description

@awesomenode

Hi,

When a deviation module adds only an extension statement (no data-node changes) to a notification, the notification's children disappear from the compiled schema.
Subsequent lyd_new_path calls for those children fail with "Not found node ... in path."

Steps to reproduce:
repro.zip

  1. A module base defines a notification with leaf children.
  2. A deviation module does deviate add { myext:annotation "value"; } on that notification — no data nodes are added, removed, or modified.
  3. After loading the deviation module, lyd_new_path("/base:my-notif/username", ...) fails.

Without the deviation loaded, the same lyd_new_path call succeeds.

Expected behavior:

A deviate add containing only extension statements should not affect the notification's data children. lyd_new_path should succeed both before and after loading
the deviation.

Actual behavior:

=== Without deviation module ===
lyd_new_path(/base:my-notif/username) => LY_SUCCESS
 
=== Loading deviation module (extension-only deviate-add) ===
lyd_new_path(/base:my-notif/username) => Validation failed
  error: Not found node "username" in path.

Version: libyang 5.6.3

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions