fix: when using JsonTypeInfo.DEDUCTION don’t add include (#587)

From the JSonTypeInfo Javadocs:

> If deduction is being used annotation properties visible, property and include are ignored.

This is causing issues with serialization downstream.
This commit is contained in:
Sergio del Amo 2025-09-30 15:59:17 +02:00 • committed by GitHub
commit 12292ab598
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1064,7 +1064,7 @@ public final class McpSchema {
/**
* 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 {