[YANGTOOLS-507] Default value not used in RPC Created: 15/Sep/15  Updated: 10/Apr/22  Resolved: 17/Sep/15

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

Type: Bug
Reporter: Shaleen Saxena 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: 4315

 Description   

This bug was seen while fixing CONTROLLER-1420. I have created a new leaf in an RPC message, and provided a default value for it.

leaf count

{ type uint16; default 0; description "Number of cars to create. Zero implies unlimited cars; use stop-stress-test rpc to stop the test."; }

During tests, if the RPC does not contain the 'count', then getCount() returns null. I expect it to return 0. I had to add the value in my implementation. This is fragile, as the code has to keep track of the default value in yang model.



 Comments   
Comment by Martin Ciglan [ 16/Sep/15 ]

This seems to be duplicate of
https://bugs.opendaylight.org/show_bug.cgi?id=2489

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