[YANGTOOLS-676] [Yang 1.1] Allow leaf-lists to have default values Created: 06/Oct/16  Updated: 10/Apr/22  Resolved: 21/Dec/16

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Peter Kajsa Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks YANGTOOLS-355 Milestone: Introduce support for YANG... Resolved
is blocked by YANGTOOLS-664 Extend yang statement parser to suppo... Resolved
is blocked by YANGTOOLS-699 Milestone: [Yang 1.1] Yang model API ... Resolved
External issue ID: 6880

 Comments   
Comment by Martin Ciglan [ 19/Oct/16 ]

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.

Comment by Igor Foltin [ 06/Nov/16 ]

API change - https://git.opendaylight.org/gerrit/#/c/47985/

Comment by Peter Kajsa [ 20/Dec/16 ]

https://git.opendaylight.org/gerrit/#/c/49473/

Generated at Wed Feb 07 20:53:58 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.