[YANGTOOLS-455] Default value may have problems Created: 19/May/15  Updated: 10/Apr/22  Resolved: 19/May/15

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

Type: Bug
Reporter: Leo Cat Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
duplicates MDSAL-63 Datastore / Restconf / Data Broker sh... Confirmed
External issue ID: 3273

 Description   

First, it seems that yangtools doesn't check default value. Like the model below:
typedef device-id {
type uint32;
}
leaf device-id {
type zenic-types:device-id;
default "abc";
}
Build always success.

Second, it will be null if doesn't set value using a builder rather than the default value:
typedef device-id {
type uint32;
}
typedef port-id {
type uint32;
}
conatiner test {
leaf dev-id

{ type device-id; mandatory "true"; }

leaf p-id

{ type port-id; default 0; }

}
If doesn't set p-id to 0 hard coding, after put and submit to datastore, there won't be p-id node.
Version is Helium-SR3.



 Comments   
Comment by Tony Tkacik [ 19/May/15 ]

MD-SAL on Helium and on Lithium does not support default statement (support for which is not required by YANG, YANG only models it).

There is already MDSAL-63 tracking it.

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