- //FIXME: get correct parent for routed RPCs only
- DataSchemaNode parent = null;
-
- ContainerSchemaNode input = rpc.getInput();
- boolean isAction = false;
- if (input != null) {
- for (DataSchemaNode schemaNode : input.getChildNodes()) {
- if (getRoutingContext(schemaNode).isPresent()) {
- isAction = true;
- break;
- }
- }
- }
-
- //routedRPC?
- if (isAction) {
- genCtx.get(module).addTopLevelNodeType(resolveOperation(parent, rpc, module, schemaContext,
- verboseClassComments, genTypeBuilders, genCtx, typeProvider, true,
- BindingNamespaceType.Data));
- } else {
- //global RPC only
- genCtx.get(module).addTopLevelNodeType(resolveOperation(parent, rpc, module, schemaContext,
- verboseClassComments, genTypeBuilders, genCtx, typeProvider, false,
- BindingNamespaceType.Data));
-
- }
+ final GeneratedTypeBuilder typeBuilder = resolveOperation(null, rpc, module, schemaContext,
+ verboseClassComments, genTypeBuilders, genCtx, typeProvider, false,
+ BindingNamespaceType.Data);
+ genCtx.get(module).addTopLevelNodeType(typeBuilder);
+ genCtx.get(module).addTypeToSchema(typeBuilder, rpc);