netmod-wg/yang-next

Treat if-feature which references a non-existing feature as valid YANG but not enabled

jbemmel opened this issue · 1 comments

Scenario: A software product comes out with a YANG model. It supports extensions referencing its model.
In release 2, a new feature is added: featureX

An extension which uses if-feature:featureX is currently incompatible with older versions of the product/YANG model, in which the feature is not defined. There is an error: Failed to resolve feature "featureX"

Instead, the extension should be accepted, treating the feature (and any nodes conditioned on it) as disabled

Agree this should be clarified.
It may be hard to change or implement.
The identifier resolution is a MUST in YANG 1.1

For C programmers:
This is the difference between

#ifdef featureX

and

#if featureX == 1   // error if featureX not defined

YANG 1.1 forces the fragile version.
Can YANG 2.0 use the #ifdef interpretation.

Must clarify