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

failed to sx:augment-structure directly under sx:structure #2338

Open
mrdotchenke opened this issue Jan 17, 2025 · 1 comment
Open

failed to sx:augment-structure directly under sx:structure #2338

mrdotchenke opened this issue Jan 17, 2025 · 1 comment
Labels
is:question Issue is actually a question.

Comments

@mrdotchenke
Copy link

Version: libyang 3.7.8

There are two modules, the module a defined sx:structure called "struct"

module a {
  yang-version 1.1;
  namespace urn:tests:extensions:structure:a;
  prefix a;
  import ietf-yang-structure-ext {
    prefix sx;
  }
  sx:structure struct {
    container n1 {
      leaf l {
        type uint32;
      }
    }
  }
}

And the module b defined sx:augment-structure to directly augment an leaf under the "/a:struct"

module b {
  yang-version 1.1;
  namespace urn:tests:extensions:structure:b;
  prefix b;
  import ietf-yang-structure-ext {
    prefix sx;
  }
  import a {
    prefix a;
  }
  sx:augment-structure "/a:struct" {
    leaf aug-leaf {
      type string;
    }
  }
}

When call lys_parse_mem with module b, after module a was successful loaded, would got an error:

libyang[0]: Augment extension target node "/a:struct" from module "b" was not found. (schemadata path: /b:{extension='sx:augment-structure'}/{augment='/a:struct'})

@michalvasko
Copy link
Member

Based on the extension definition, I believe, you must target an actual data node, the structure itself is not allowed (it would result in "top-level" augment nodes). So try using

sx:augment-structure "/a:struct/a:n1" {
   ...

@michalvasko michalvasko added the is:question Issue is actually a question. label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:question Issue is actually a question.
Projects
None yet
Development

No branches or pull requests

2 participants