Subject: [netmod] 2 YANG 1.1 questions

From: Andy Bierman <[email-masked]>
Date: Sat, 30 Jan 2016 13:41:04 -0800

Hi,

1) leafref with a default-stmt

  list int {
    key "name type";
    leaf name { type string; }
    leaf type { type string; }
    leaf enabled { type boolean; }
  }

  typedef lref1 {
    type leafref { path "/int/name"; }
    default "t0";
  }

This has the save effect as top-level mandatory nodes.
The require-instance is 'true' so the YANG validation will fail
at boot-time unless a list 'int' entry name is 't0'.

I plan to add a YANG usage guide not to give configuration
leafref nodes a default value. Any objections or another plan?

2) instance-identifier encoding for key type 'empty'.

  list int2 {
    key "test test2";
    leaf test { type empty; }
    leaf test2 { type empty; }
    leaf type { type string; }
  }

Now that the empty type is allowed for a key leaf,
the <error-path> and any instance-identifier type needs to
have encoding rules defined. (e.g. an instance of /int2/type)

Andy