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.JsonRpcResponse;
|
||||
import io.shinhanlife.dat.biz.mcp.registry.ToolRegistryClient;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -118,9 +117,6 @@ public class InitializeHandler implements McpMethodHandlerRegistry.Handler {
|
||||
}
|
||||
List<JsonNode> routingManifests =
|
||||
registryClient.fetchRoutingManifests(routeKey, routingHintsProperties.manifestPath());
|
||||
Map<String, Object> meta = new LinkedHashMap<>();
|
||||
meta.put("routeKey", routeKey);
|
||||
meta.put("toolServers", routingManifests);
|
||||
return meta;
|
||||
return Map.of("toolServers", routingManifests);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class InitializeHandlerTest {
|
||||
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());
|
||||
|
||||
assertThat(serialized.path("_meta").path("routeKey").asText()).isEqualTo("external");
|
||||
assertThat(serialized.path("_meta").has("routeKey")).isFalse();
|
||||
assertThat(serialized.path("_meta").path("toolServers"))
|
||||
.singleElement()
|
||||
.isEqualTo(routingManifest);
|
||||
|
||||
Reference in New Issue
Block a user