Clean up ietf-netconf-monitoring-extension
[netconf.git] / restconf / restconf-common / src / main / java / org / opendaylight / restconf / common / util / OperationsResourceUtils.java
index 7460f92aaa7742d02bc9401075975456181cea0a..ada0442bc0710855c67a438ed8c72411935895f8 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
 
 
 // FIXME: remove this class
@@ -60,7 +61,10 @@ public final class OperationsResourceUtils {
             operationsBuilder.withChild(ImmutableNodes.leafNode(leaf.getQName(), Empty.value()));
         }
 
-        return Map.entry(new InstanceIdentifierContext(null, operatationsSchema, mountPoint,
-            new OperationsEffectiveModuleContext(ImmutableSet.copyOf(modules))), operationsBuilder.build());
+        final var opContext = new OperationsEffectiveModuleContext(ImmutableSet.copyOf(modules));
+        final var stack = SchemaInferenceStack.of(opContext);
+        stack.enterSchemaTree(operatationsSchema.getQName());
+
+        return Map.entry(InstanceIdentifierContext.ofStack(stack, mountPoint), operationsBuilder.build());
     }
 }