BUG-9132: don't provide a value for restconf/streams/events 54/63854/1
authorEvan Zeller <evanrzeller@gmail.com>
Thu, 28 Sep 2017 01:15:31 +0000 (18:15 -0700)
committerEvan Zeller <evanrzeller@gmail.com>
Fri, 29 Sep 2017 19:56:25 +0000 (12:56 -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/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java

index 8a869a58ccae495e7164a2665238400f7ff0e2ed..99200cb845f8d1c3aba750a9c7b9c8de5ed15653 100644 (file)
@@ -1508,7 +1508,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();
     }