|
RFC7950:
7.7.2. The leaf-list’s Default Values
The default values of a leaf-list are the values that the server uses
if the leaf-list does not exist in the data tree. The usage of the
default values depends on the leaf-list’s closest ancestor node in
the schema tree that is not a non-presence container (see
Section 7.5.1):
o If no such ancestor exists in the schema tree, the default values
MUST be used.
o Otherwise, if this ancestor is a case node, the default values
MUST be used if any node from the case exists in the data tree or
the case node is the choice’s default case, and if no nodes from
any other case exist in the data tree.
o Otherwise, the default values MUST be used if the ancestor node
exists in the data tree.
In these cases, the default values are said to be in use.
Note that if the leaf-list or any of its ancestors has a "when"
condition or "if-feature" expression that evaluates to "false", then
the default values are not in use.
When the default values are in use, the server MUST operationally
behave as if the leaf-list was present in the data tree with the
default values as its values.
If a leaf-list has one or more "default" statements, the leaf-list’s
default values are the values of the "default" statements, and if the
leaf-list is user ordered, the default values are used in the order
of the "default" statements. Otherwise, if the leaf-list’s type has
a default value and the leaf-list does not have a "min-elements"
statement with a value greater than or equal to one, then the
leaf-list’s default value is one instance of the type’s default
value. In all other cases, the leaf-list does not have any default
values.
|