Subject: [netmod] can a leaf of type "empty" have a "default" value?

From: Kent Watsen <[email-masked]>
Date: Fri, 17 May 2019 19:52:50 +0000

A leaf with type "empty" is often times used to represent a boolean: present == set, not present == not set.  Is there a way in YANG to specify that the "empty" type leaf is "set" by default?  Perhaps like this:

    leaf flag {
        type empty;
        default "";
    }

Kent // contributor

---

From: "Reshad Rahman (rrahman)" <[email-masked]>
Date: Fri, 17 May 2019 19:59:41 +0000

Hi Kent,

From https://tools.ietf.org/html/rfc7950#section-9.11
An empty type cannot have a default value.

Regards,
Reshad.

From: netmod <[email-masked]> on behalf of Kent Watsen <[email-masked]>
Date: Friday, May 17, 2019 at 3:53 PM
To: "[email-masked]" <[email-masked]>
Subject: [netmod] can a leaf of type "empty" have a "default" value?

    leaf flag {
        type empty;
        default "";
    }

Kent // contributor

---

From: Kent Watsen <[email-masked]>
Date: Fri, 17 May 2019 21:44:42 +0000

Oh bother, my eyes glossed right over that.  Thanks for spotting it!

K.

> On May 17, 2019, at 3:59 PM, Reshad Rahman (rrahman) <[email-masked]> wrote:
> 
> Hi Kent,
>  
> From https://tools.ietf.org/html/rfc7950#section-9.11 <https://tools.ietf.org/html/rfc7950#section-9.11>