Add Support for Jackson 3 (#742)

This change adds Jackson 3 support and aligns package naming in the existing Jackson 2 module.

Specific changes:
* Deprecated classes for removal in `io.modelcontextprotocol.json.jackson`/`io.modelcontextprotocol.json.schema.jackson`
* Copied the above to `io.modelcontextprotocol.json.jackson2`/`io.modelcontextprotocol.json.schema.jackson2` in non-deprecated form.
* Added tests for the default McpJsonMapper and JsonSchemaValidator
This commit is contained in:
Filip Hrisafov 2026-01-26 11:43:35 +01:00 • committed by GitHub
commit 2456a0e433
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,7 +118,8 @@ public class WebMvcStatelessServerTransport implements McpStatelessServerTranspo
.handleRequest(transportContext, jsonrpcRequest)
.contextWrite(ctx -> ctx.put(McpTransportContext.KEY, transportContext))
.block();
return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(jsonrpcResponse);
String json = jsonMapper.writeValueAsString(jsonrpcResponse);
return ServerResponse.ok().contentType(MediaType.APPLICATION_JSON).body(json);
}
catch (Exception e) {
logger.error("Failed to handle request: {}", e.getMessage());