From 23f1b4570f27dd6956446d47414cf825791c170a Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Tue, 30 Sep 2025 11:33:42 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20when=20using=20JsonTypeInfo.DEDUCTION=20?= =?UTF-8?q?don=E2=80=99t=20add=20include?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the JSonTypeInfo Javadocs: > If deduction is being used annotation properties visible, property and include are ignored. This is causing issues with serialization downstream. --- .../src/main/java/io/modelcontextprotocol/spec/McpSchema.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 792aa54fa..8186bb199 100644 --- a/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java +++ b/mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java @@ -1064,7 +1064,7 @@ public UnsubscribeRequest(String uri) { /** * The contents of a specific resource or sub-resource. */ - @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION, include = As.PROPERTY) + @JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION) @JsonSubTypes({ @JsonSubTypes.Type(value = TextResourceContents.class, name = "text"), @JsonSubTypes.Type(value = BlobResourceContents.class, name = "blob") }) public sealed interface ResourceContents extends Meta permits TextResourceContents, BlobResourceContents {