netmod-wg / yang-next

Feature requests for future versions of YANG
6 stars 0 forks source link

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

Open jbemmel opened 2 years ago

jbemmel commented 2 years ago

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

abierman commented 1 week ago

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