[MDSAL-193] Default values not filled for BA RPC Created: 22/Aug/16 Updated: 17/Nov/22 |
|
| Status: | In Progress |
| Project: | mdsal |
| Component/s: | Binding runtime |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Jan Medved | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| External issue ID: | 6488 | ||||||||
| Description |
|
I specified default values for leafs in a model of an RPC, and the values are not being filled by the system. The model is attached. This issue is happening on master (carbon) |
| Comments |
| Comment by Jan Medved [ 22/Aug/16 ] |
|
Attachment shardingsimple.yang has been added with description: Yang model where the bug can be reproduced |
| Comment by Igor Foltin [ 22/Aug/16 ] |
|
Hi Jan, I tested the attached model in the yang parser and all default values were filled out correctly in the produced SchemaContext. Could you please provide more info, e.g. circumstances under which you ran into this problem or perhaps a unit test. Thanks |
| Comment by Peter Kajsa [ 23/Aug/16 ] |
|
This seems to be duplicate of |
| Comment by Jan Medved [ 24/Aug/16 ] |
|
Hi Igor, I retested the use case. The problem occurs for one specific case, when the json is entirely empty ( '{}'). I added one value for the input (test type) as follows: { } and all the other values were filled in. I guess the problem is when no data whatsoever is specified (empty json) - I think for RPCs in that case all default values should be filled in. To reproduce: 1. check our coretutorials in the current master: > git clone https://git.opendaylight.org/gerrit/coretutorials.git 2. Go to the clustering/shardingsimple folder > cd coretutorials/clustering/shardingsimple 3. Build: 4. Run the built distro: 5. Point the local browser at the controller - open 6. Click on yangman, if the above URL did not get you there. Click on the shardingsimple model, then on operations, and then click the red SEND button. You will see the exception on ODL |
| Comment by Peter Kajsa [ 27/Oct/16 ] |
|
After further discusion it seems it is a bug in md-sal. Hence the bug has been reopened and moved to md-sal. |
| Comment by Robert Varga [ 27/Oct/16 ] |
|
Binding Aware LazyDataObject should be filling in default nodes, we need to create a unit test in binding-dom-codec |
| Comment by Robert Varga [ 26/Jan/18 ] |
|
Based on the difference between when a single leaf is present and completely empty input, the problem is that nested DataObjects are not instantiated, leading to Input not being present. |
| Comment by Robert Varga [ 26/Jan/18 ] |
|
This is an interesting side-effect of allowing nulls in invokeRpc() path. The idea that an RPC does not take arguments is not correct: RPC input statement is present implicitly and can externally be augmented – which implies that even RPCs that do not spell out an input statement still take an empty container as the argument. This then maps to the requested functionality: there is an input object which can have default leaves, as opposed to current mode of operation, when input is non-existent and there are not leaves.
|