say I have this
container c {
leaf l1;
leaf l2 (default 'abcd');
}
and I do this (restconf):
DELETE /c/l2
what is the expected behavior in the server ? is it
- 'delete the leaf data' or
- 'do not delete but preserve the leaf with default value'
after issuing the delete , what is the expected result for a GET
GET /c
c {
l1 : 100 // for ex
l2 : 'abcd'
}
This is described in RFC7950, Section 7.6.1:
In your case
c
is a non-presence container, therefore the first bullet above kicks in. This means your default will be in use if you delete the corresponding leaf from the data tree (yes, you can delete it). The server MUST therefore operationally behave as if the leaf was present, and this leaf must have the specified default value.It does not matter which protocol is used to do the operations.
For RESTCONF and GET, the behavior is described in Section 3.5.4:
So your GET example may or may not be correct, depending on which defaults handling mode is in effect, as the last paragraph above suggests.