RFC 7950 says:

   As a shorthand, the "case" statement can be omitted if the branch
   contains a single "anydata", "anyxml", "choice", "container", "leaf",
   "list", or "leaf-list" statement.  In this case, the case node still
   exists in the schema tree, and its identifier is the same as the
   identifier of the child node.

This seems clear, albeit incomplete, as inconsistencies [1] exist amongst 
`pyang`and `yanglint` (I did not test with `yangson`) in how the “if-feature” 
statement is handled, though I imagine other statements (e.g., “when”) may also 
fall into this discussion as well.

Ultimately, the question is what Errata and/or YANG-next issue should be filed. 
  I’m okay either way, so long as it’s clear and can be implemented 
consistently across tooling.

In the meanwhile, I recommend module designers avoid using the shorthand 
notation, as there are no known issues with the “longhand” notation.

[1] https://github.com/mbj4668/pyang/issues/559

Kent // contributor


_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to