[CONTROLLER-1359] RESTCONF: GET operation on a node in a list, identified by leaf-ref fails. Created: 05/Jun/15  Updated: 25/Jul/23  Resolved: 10/Jun/15

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Deepthi V V Assignee: Jan Hajnar
Resolution: Done 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: 3595

 Description   

Reference yang:
container vpn-interfaces {
description
"VPN is enabled on interfaces.";

list vpn-interface {
key "name";
max-elements "unbounded";
min-elements "0";
leaf name {
type leafref

{ path "/if:interfaces/if:interface/if:name"; }

}
leaf vpn-instance-name {
type string

{ length "1..40"; }

}
}
}

GET on URL http://localhost:8181/restconf/config/l3vpn:vpn-interfaces/ successful.

GET on URL http://localhost:8181/restconf/config/l3vpn:vpn-interfaces/vpn-interface/s1-eth1 fails with following error:
{
"errors": {
"error": [

{ "error-type": "protocol", "error-tag": "invalid-value", "error-message": "s1-eth1 from URI can't be resolved. " }

]
}
}

Other observations:
1. Read from datastore using JAVA APIs works fine.
2. No error observed in log file.



 Comments   
Comment by Deepthi V V [ 05/Jun/15 ]

Traced code flow:

Class: ControllerContext.java
Method: addKeyValue
final Codec<Object, Object> codec = RestCodec.from(typedef, mountPoint);
returns null.

Reason:
RestCodec.java :: ObjectCode class :: deserialize method does not handle leafref deserialization.

Comment by Jan Hajnar [ 08/Jun/15 ]

patch:
https://git.opendaylight.org/gerrit/#/c/22112/

Generated at Wed Feb 07 19:55:21 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.