|
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.
|