Ditch use of RpcDefintion.getOutput().getPath()
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / rest / impl / NormalizedNodeJsonBodyWriter.java
index a797215ac3f411638b39af4f2b03a8a70253ff1a..50ca47bbd4e9db2e08c73f81566d9725a532de1d 100644 (file)
@@ -128,7 +128,8 @@ public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter<Normalize
              *  RpcDefinition is not supported as initial codec in JSONStreamWriter,
              *  so we need to emit initial output declaratation..
              */
-            path = ((RpcDefinition) context.getSchemaNode()).getOutput().getPath();
+            final var rpc = (RpcDefinition) context.getSchemaNode();
+            path = SchemaPath.create(true, rpc.getQName(), rpc.getOutput().getQName());
             nnWriter = createNormalizedNodeWriter(context, path, jsonWriter, depth);
             jsonWriter.name("output");
             jsonWriter.beginObject();