Remove route key from initialize metadata
All checks were successful
Deploy Gateway / deploy (push) Successful in 2m27s
All checks were successful
Deploy Gateway / deploy (push) Successful in 2m27s
This commit is contained in:
@@ -8,7 +8,6 @@ import io.shinhanlife.dat.biz.mcp.context.McpRequestContext;
|
|||||||
import io.shinhanlife.dat.biz.mcp.jsonrpc.JsonRpcRequest;
|
import io.shinhanlife.dat.biz.mcp.jsonrpc.JsonRpcRequest;
|
||||||
import io.shinhanlife.dat.biz.mcp.jsonrpc.JsonRpcResponse;
|
import io.shinhanlife.dat.biz.mcp.jsonrpc.JsonRpcResponse;
|
||||||
import io.shinhanlife.dat.biz.mcp.registry.ToolRegistryClient;
|
import io.shinhanlife.dat.biz.mcp.registry.ToolRegistryClient;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -118,9 +117,6 @@ public class InitializeHandler implements McpMethodHandlerRegistry.Handler {
|
|||||||
}
|
}
|
||||||
List<JsonNode> routingManifests =
|
List<JsonNode> routingManifests =
|
||||||
registryClient.fetchRoutingManifests(routeKey, routingHintsProperties.manifestPath());
|
registryClient.fetchRoutingManifests(routeKey, routingHintsProperties.manifestPath());
|
||||||
Map<String, Object> meta = new LinkedHashMap<>();
|
return Map.of("toolServers", routingManifests);
|
||||||
meta.put("routeKey", routeKey);
|
|
||||||
meta.put("toolServers", routingManifests);
|
|
||||||
return meta;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class InitializeHandlerTest {
|
|||||||
var response = handler.handle(request, io.shinhanlife.dat.biz.mcp.TestFixtures.context());
|
var response = handler.handle(request, io.shinhanlife.dat.biz.mcp.TestFixtures.context());
|
||||||
var serialized = io.shinhanlife.dat.biz.mcp.TestFixtures.OBJECT_MAPPER.valueToTree(response.result());
|
var serialized = io.shinhanlife.dat.biz.mcp.TestFixtures.OBJECT_MAPPER.valueToTree(response.result());
|
||||||
|
|
||||||
assertThat(serialized.path("_meta").path("routeKey").asText()).isEqualTo("external");
|
assertThat(serialized.path("_meta").has("routeKey")).isFalse();
|
||||||
assertThat(serialized.path("_meta").path("toolServers"))
|
assertThat(serialized.path("_meta").path("toolServers"))
|
||||||
.singleElement()
|
.singleElement()
|
||||||
.isEqualTo(routingManifest);
|
.isEqualTo(routingManifest);
|
||||||
|
|||||||
Reference in New Issue
Block a user