From fc0fa648a908ea9ee39f466146cea2b9c535e036 Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Mon, 6 Oct 2025 12:24:32 +0200 Subject: [PATCH] fix remove name when using deduction This pull-request removes the name member from the @JsonSubTypes.Type annotations when using JsonTypeInfo.Id.DEDUCTION. With DEDUCTION, Jackson ignores the name entirely because it's inferring the type from the structure. --- .../src/main/java/io/modelcontextprotocol/spec/McpSchema.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java b/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java index 12835a57a..f56cf65c9 100644 --- a/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java +++ b/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java @@ -1064,8 +1064,8 @@ public UnsubscribeRequest(String uri) { * The contents of a specific resource or sub-resource. */ @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) - @JsonSubTypes({ @JsonSubTypes.Type(value = TextResourceContents.class, name = "text"), - @JsonSubTypes.Type(value = BlobResourceContents.class, name = "blob") }) + @JsonSubTypes({ @JsonSubTypes.Type(value = TextResourceContents.class), + @JsonSubTypes.Type(value = BlobResourceContents.class) }) public sealed interface ResourceContents extends Meta permits TextResourceContents, BlobResourceContents { /**