Subject: [netmod] Issue Y07: if-feature on keys

From: Andy Bierman <[email-masked]>
Date: Mon, 7 Apr 2014 15:52:44 -0700

Hi,

The following issue is incorrect.

The YANG compiler needs to check for any
if-feature mismatch between all key leafs and their parent list node.

Y07: do not allow when or if-feature on keys

** Description

  All keys to a list must always be implemented.  Thus, the following
  does not make any sense and should be illegal:

    list foo {
      key "a";
      leaf a {
        type int32;
        if-feature bar;  // should be illegal
        when "/baz";     // should be illegal
      }
    }

The if-feature-stmt is already allowed in YANG 1.0.
How will YANG 1.0 modules compile 100% if it is now
illegal to place an if-feature-stmt on a leaf.  What if the leaf
is inherited from a uses-stmt that has if-feature-stmts?

YANG 1.1 should be specific:
  - conditional key leafs MUST have the same if-features
    (or some could be missing) as their parent list node.
 - all key leafs MUST have the exact same if-feature-stmts applied

Andy