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

Validation of YANG leafref within union does not work #498

Open
olofhagsand opened this issue Feb 28, 2024 · 0 comments
Open

Validation of YANG leafref within union does not work #498

olofhagsand opened this issue Feb 28, 2024 · 0 comments
Labels

Comments

@olofhagsand
Copy link
Member

Suppose one has the following yang:

container a {
   leaf ref {
     type reftype;
   }
  list b {
    key c;
    leaf c;
 }
}

And the following CLI commands:

cli> set a b x
cli> set a ref y
error: validation fail

This works, if reftype is:

 typedef reftype {
            type leafref {
                path "/a/b/c";
            }
  }

But the following does not work (validation does not fail)if reftype is a leafref within a union:

typedef reftype {
       type union {
               type string {
                   pattern 'default';
               }
               type leafref {
                   path "/a/b/c";
               }
           }
}
@olofhagsand olofhagsand changed the title Validation of YANG leafref within union does not work #108 Validation of YANG leafref within union does not work Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant