Here short-hand case statement means that we can ignore 'case' keyword and use anotherr node identifier directly assuming that only that node identifier will be present in implicit case branch.
But the loading fails for such a file.
File used: aug-test-5.yang
module aug-test-5 {
namespace "urn:netcracker:params:basic_augment";
prefix basic_augment;
yang-version 1.1;
augment "/root-container/choice-init" {
choice choice-D {
case case-D1 {
leaf leaf-D1 {
type string;
}
}
}
}
augment "/root-container/choice-init" {
case case-C {
leaf leaf-aug-1 {
type string;
}
}
case case-D {
leaf-list leaf-list-aug-1{
type string;
}
}
}
container root-container {
container container-init{
leaf leaf-init1 {
type string;
}
}
list list-init {
leaf leaf-init2 {
type string;
}
}
choice choice-init {
case case-A {
leaf leaf-init3 {
type string;
}
}
case case-B {
leaf leaf-init4 {
type string;
}
}
container case-container {
leaf leaf-init5 {
type string;
}
}
list case-list {
leaf leaf-init6 {
type string;
}
}
}
}
}
If we try to augment a choice to a choice, it throws the below error. *meta.Choice not a recognizable parent for
As per https://www.rfc-editor.org/rfc/rfc7950.html#section-7.17, there is as below If the target node is a choice node, the "case" statement or a shorthand "case" statement (see Section 7.9.2) can be used within the "augment" statement.
Here short-hand case statement means that we can ignore 'case' keyword and use anotherr node identifier directly assuming that only that node identifier will be present in implicit case branch.
But the loading fails for such a file.
File used: aug-test-5.yang