[NETCONF-468] Default values in yang are not set when fetch from datastore with restconf Created: 08/Sep/17  Updated: 15/Mar/19  Resolved: 04/Oct/17

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Vikram Darsi Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 9128

 Description   

Hi Netconf-dev

When we have data model with leafs having default values.
For ex:
leaf ip-address

{ type string; default 127.0.0.1; }

I don’t see the ip-address value in my restconf response. Where when I check the dataobject, the object has the default value set.
How do I ensure the default value is set even in mdsal?

We are right now using Boron SR3.



 Comments   
Comment by Tomas Cere [ 04/Oct/17 ]

The yang rfc: https://tools.ietf.org/html/rfc6020#section-7.6.1
states that when the leaf does not have a value and has a default value the server "MUST operationally behave as if the leaf was present in the data tree with the default value as its value."

It's not state anywhere that the default value has to be present in the datastore. I think the default value is only present in generated bindings and not NormalizedNodes which restconf uses.

This discussion should be aimed on mdsal since this is out of scope of restconf.
But i think that the mdsal team stated multiple times that the default values should NOT be present in the datastore.

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