Fix root data node QName equality check 75/68375/2
authorIgor Foltin <igor.foltin@pantheon.tech>
Fri, 16 Feb 2018 16:43:24 +0000 (17:43 +0100)
committerIgor Foltin <igor.foltin@pantheon.tech>
Sat, 24 Feb 2018 16:20:11 +0000 (16:20 +0000)
This fixes the http error status 500 when trying to read
the whole mounted datastore using the new restconf
implementation based on RFC8040.

When serializing a NormalizedNode that represents
the data root we need to serialize only its children.

Change-Id: Ibd7bd71fe6f36674f62b9d974c85045c359cc6b1
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/ParameterAwareNormalizedNodeWriter.java

index c86bd6fcb3d3c1868c869f5d2587c4d1f2f67526..29609834f16cab2be08b748040acf66423cc5321 100644 (file)
@@ -263,7 +263,7 @@ public class ParameterAwareNormalizedNodeWriter implements RestconfNormalizedNod
         boolean processedAsCompositeNode = false;
         if (node instanceof ContainerNode) {
             final ContainerNode n = (ContainerNode) node;
-            if (!n.getNodeType().equals(ROOT_DATA_QNAME)) {
+            if (!n.getNodeType().withoutRevision().equals(ROOT_DATA_QNAME)) {
                 if (writer instanceof NormalizedNodeStreamAttributeWriter) {
                     ((NormalizedNodeStreamAttributeWriter) writer).startContainerNode(
                             n.getIdentifier(), childSizeHint(n.getValue()), n.getAttributes());