fix: Add JsonInclude annotation to notification records for proper serialization (#552)
Add @JsonInclude(JsonInclude.Include.NON_ABSENT) to ResourcesUpdatedNotification and to LoggingMessageNotification This ensures that absent (null/Optional.empty()) fields are excluded from JSON serialization, preventing potential serialization issues with these MCP notification types. Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
parent
bc3a925bdc
commit
7e3ea73815
1 changed files with 2 additions and 0 deletions
|
|
@ -2203,6 +2203,7 @@ public final class McpSchema {
|
|||
* @param uri The updated resource uri.
|
||||
* @param meta See specification for notes on _meta usage
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_ABSENT)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record ResourcesUpdatedNotification(// @formatter:off
|
||||
@JsonProperty("uri") String uri,
|
||||
|
|
@ -2224,6 +2225,7 @@ public final class McpSchema {
|
|||
* @param data JSON-serializable logging data.
|
||||
* @param meta See specification for notes on _meta usage
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_ABSENT)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public record LoggingMessageNotification( // @formatter:off
|
||||
@JsonProperty("level") LoggingLevel level,
|
||||
|
|
|
|||
Loading…
Reference in a new issue