-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Describe the bug
gNMI get response parser fails on empty values, e.g.
{
"openconfig-acl:acl": {
"acl-sets": null
}
}Solution
The solution is to add VALUE_NOT_SET case to updateToNormalizedNode method in lighty-modules\lighty-gnmi\lighty-gnmi-sb\src\main\java\io\lighty\gnmi\southbound\mountpoint\codecs\GetResponseToNormalizedNodeCodec.java. I can't figure out how to do it with gson library used. I would be grateful if you could do it.
Workaround
In the meanwhile I applied the following workaround (last 3 lines):
public Optional<NormalizedNode> apply(Gnmi.GetResponse response, YangInstanceIdentifier identifier)
throws GnmiCodecException {
for (Gnmi.Notification notification : response.getNotificationList()) {
if (!notification.getUpdateList().isEmpty()) {
// Json to NormalizedNode
final var update = notification.getUpdateList().get(0);
if (update.getVal().getValueCase() == Gnmi.TypedValue.ValueCase.VALUE_NOT_SET) {
return Optional.empty();
}Metadata
Metadata
Assignees
Labels
No labels