Subject: [netmod] “case” shorthand

From: "Peter Kajsa -X (pkajsa - PANTHEON TECHNOLOGIES at Cisco)" <[email-masked]>
Date: Mon, 20 Mar 2017 08:46:51 +0000

Hi,

RFC7950 section 7.9.2. says that if a “case” statement is omitted (i.e. “case” shorthand) and implicit “case” node is created, schema node identifiers MUST always explicitly include the implicit “case” node identifiers. So the following snippet from yang model (below) is valid for Yang 1.1. However, is it also valid for Yang 1.0 ? RFC6020 is not clear about this and there is no section saying that schema node identifiers MUST always explicitly include the implicit “case” node identifiers…

    choice my-choice {
        container implicit-case-container {
        }
    }

    augment "/my-choice/implicit-case-container" {
        leaf leaf-after-container {
            type empty;
        }
    }

    augment "/my-choice/implicit-case-container/implicit-case-container" {
        leaf leaf-inside-container {
            type empty;
        }
    }

Thanks.
[http://wwwin.cisco.com/c/dam/cec/organizations/gmcc/services-tools/signaturetool/images/logo/logo_Cisco_Blue.png]

Peter Kajsa
Engineer - Software
[email-masked]<mailto:[email-masked]>
Tel:

Cisco Systems, Inc.

Slovakia
cisco.com

[http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif]Think before you print.

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.
Please click here<http://www.cisco.com/web/about/doing_business/legal/cri/index.html> for Company Registration Information.

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 20 Mar 2017 10:10:39 +0100 (CET)

"Peter Kajsa -X (pkajsa - PANTHEON TECHNOLOGIES at Cisco)" <[email-masked]> wrote:
> Hi,
> 
> RFC7950 section 7.9.2. says that if a “case” statement is omitted
> (i.e. “case” shorthand) and implicit “case” node is created, schema
> node identifiers MUST always explicitly include the implicit “case”
> node identifiers. So the following snippet from yang model (below) is
> valid for Yang 1.1. However, is it also valid for Yang 1.0 ? RFC6020
> is not clear about this and there is no section saying that schema
> node identifiers MUST always explicitly include the implicit “case”
> node identifiers…

Yes, this works the same way in both YANG 1 and 1.1.  The new sentence
was added as a clarification to 7950.

/martin

> This email may contain confidential and privileged material for the
> sole use of the intended recipient. Any review, use, distribution or
> disclosure by others is strictly prohibited. If you are not the
> intended recipient (or authorized to receive for the recipient),
> please contact the sender by reply email and delete all copies of this
> message.
> Please click
> here<http://www.cisco.com/web/about/doing_business/legal/cri/index.html>
> for Company Registration Information.
> 
>