BUG 2412 - restconf @POST invokeRpc with nopayload method
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / restconf / impl / ControllerContext.java
index 8bdf401300e91d4e3a67c7e0e58970e432a1283b..5566f01674a3112e2f0dd09c8287b17a9e0752b4 100644 (file)
@@ -587,6 +587,15 @@ public class ControllerContext implements SchemaContextListener {
             }
 
             targetNode = findInstanceDataChildByNameAndNamespace(parentNode, nodeName, module.getNamespace());
+
+            if (targetNode == null && parentNode instanceof Module) {
+                final RpcDefinition rpc = ControllerContext.getInstance().getRpcDefinition(head);
+                if (rpc != null) {
+                    return new InstanceIdentifierContext<RpcDefinition>(builder.build(), rpc, mountPoint,
+                            mountPoint != null ? mountPoint.getSchemaContext() : globalSchema);
+                }
+            }
+
             if (targetNode == null) {
                 throw new RestconfDocumentedException("URI has bad format. Possible reasons:\n" + " 1. \"" + head
                         + "\" was not found in parent data node.\n" + " 2. \"" + head