netmod-wg / yang-next

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

add 'recommended-default' statement #89

Open abierman opened 5 years ago

abierman commented 5 years ago

It is important to maintain backward compatibility with existing program behavior. Often the YANG default is not the recommended setting, but rather the setting that matches current program behavior. Sometimes objects are default "off" to conserve resources.

Even if a YANG default is assigned, the recommended setting may change over time. A YANG default is not supposed to ever change, once it is added to a YANG module.

Therefore another statement such as "recommended-default" is needed, which is allowed to change. It is also useful if a static YANG default cannot be specified which is MUST implement. This new setting would just be a hint to clients and servers. It will not override a YANG default-stmt. The value MAY be used by the server as a default if the there is no default-stmt.

abierman commented 1 month ago

This is low importance because the description-stmt can be used. We use multiple release trains for YANG modules. When a new leaf is added, the default is always NO CHANGE to existing behavior, even if the new behavior is deemed to be better. After some number of release trains the default is changed (!) to the recommended behavior.

A machine-readable statement will allow tools to warn if the recommended settings are not used.

abierman commented 2 weeks ago

This could be done as an extension. It is metadata and not something to implement in a compiler or server.

Complexity: low, bc: high, importance: low