BUG-9132: don't provide a value for restconf/streams/events 55/63855/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:57:12 +0000 (19:57 +0000)
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>
(cherry picked from commit 9ae46c73bc2437dc1dab54498b3a64c0600fa9e8)

restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/RestconfImpl.java

index 38dc35be2f72ba2a887c02eb903bb4d4a8d6ac2f..e86bbd1deed3b8843ca915b108f280aed2ed45cc 100644 (file)
@@ -1492,7 +1492,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();
     }