BUG-9132: don't provide a value for restconf/streams/events 29/63729/1
authorEvan Zeller <evanrzeller@gmail.com>
Thu, 28 Sep 2017 01:15:31 +0000 (18:15 -0700)
committerEvan Zeller <evanrzeller@gmail.com>
Thu, 28 Sep 2017 01:22:54 +0000 (18:22 -0700)
The yang type of events leaf is 'type empty', meaning there should be no value.
As of Carbon performing a GET on restconf/streams causes a cast
exception due to the empty string value here. See EmptyJSONCodec in
yangtools.

Change-Id: If0501b9c5459f4255096a4f070968c87a749407e
Signed-off-by: Evan Zeller <evanrzeller@gmail.com>
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java

index 19a130fafe6f921aecda5c6f30ea8e7480dd00aa..a544a712965d0944c7be8118844db76b48be2847 100644 (file)
@@ -1503,7 +1503,7 @@ public class RestconfImpl implements RestconfService {
         instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(listStreamSchemaNode, "events");
         final DataSchemaNode eventsSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
         Preconditions.checkState(eventsSchemaNode instanceof LeafSchemaNode);
-        streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) eventsSchemaNode).withValue("").build());
+        streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) eventsSchemaNode).build());
 
         return streamNodeValues.build();
     }