Refine McpJsonDefaults method names (#789)
As a follow-up of #779, this commit refines McpJsonDefaults method names by shortening them to not repeat the qualifiers already expressed at type level.
This commit is contained in:
parent
8549e36dfc
commit
e60a0743a5
7 changed files with 94 additions and 108 deletions
|
|
@ -616,9 +616,8 @@ public class WebClientStreamableHttpTransport implements McpClientTransport {
|
|||
* @return a new instance of {@link WebClientStreamableHttpTransport}
|
||||
*/
|
||||
public WebClientStreamableHttpTransport build() {
|
||||
return new WebClientStreamableHttpTransport(
|
||||
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, webClientBuilder,
|
||||
endpoint, resumableStreams, openConnectionOnStartup, supportedProtocolVersions);
|
||||
return new WebClientStreamableHttpTransport(jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper,
|
||||
webClientBuilder, endpoint, resumableStreams, openConnectionOnStartup, supportedProtocolVersions);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ public class WebFluxSseClientTransport implements McpClientTransport {
|
|||
*/
|
||||
public WebFluxSseClientTransport build() {
|
||||
return new WebFluxSseClientTransport(webClientBuilder,
|
||||
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, sseEndpoint);
|
||||
jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper, sseEndpoint);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -562,9 +562,8 @@ public class WebFluxSseServerTransportProvider implements McpServerTransportProv
|
|||
*/
|
||||
public WebFluxSseServerTransportProvider build() {
|
||||
Assert.notNull(messageEndpoint, "Message endpoint must be set");
|
||||
return new WebFluxSseServerTransportProvider(
|
||||
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, baseUrl,
|
||||
messageEndpoint, sseEndpoint, keepAliveInterval, contextExtractor, securityValidator);
|
||||
return new WebFluxSseServerTransportProvider(jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper,
|
||||
baseUrl, messageEndpoint, sseEndpoint, keepAliveInterval, contextExtractor, securityValidator);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,9 +245,8 @@ public class WebFluxStatelessServerTransport implements McpStatelessServerTransp
|
|||
*/
|
||||
public WebFluxStatelessServerTransport build() {
|
||||
Assert.notNull(mcpEndpoint, "Message endpoint must be set");
|
||||
return new WebFluxStatelessServerTransport(
|
||||
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, mcpEndpoint,
|
||||
contextExtractor, securityValidator);
|
||||
return new WebFluxStatelessServerTransport(jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper,
|
||||
mcpEndpoint, contextExtractor, securityValidator);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -533,8 +533,8 @@ public class WebFluxStreamableServerTransportProvider implements McpStreamableSe
|
|||
public WebFluxStreamableServerTransportProvider build() {
|
||||
Assert.notNull(mcpEndpoint, "Message endpoint must be set");
|
||||
return new WebFluxStreamableServerTransportProvider(
|
||||
jsonMapper == null ? McpJsonDefaults.getDefaultMcpJsonMapper() : jsonMapper, mcpEndpoint,
|
||||
contextExtractor, disallowDelete, keepAliveInterval, securityValidator);
|
||||
jsonMapper == null ? McpJsonDefaults.getMapper() : jsonMapper, mcpEndpoint, contextExtractor,
|
||||
disallowDelete, keepAliveInterval, securityValidator);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ public class WebFluxServerTransportSecurityIntegrationTests {
|
|||
public McpSyncClient createMcpClient(String baseUrl, TestHeaderExchangeFilterFunction exchangeFilterFunction) {
|
||||
var transport = WebFluxSseClientTransport
|
||||
.builder(WebClient.builder().baseUrl(baseUrl).filter(exchangeFilterFunction))
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.jsonMapper(McpJsonDefaults.getMapper())
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ public class WebFluxServerTransportSecurityIntegrationTests {
|
|||
public McpSyncClient createMcpClient(String baseUrl, TestHeaderExchangeFilterFunction exchangeFilterFunction) {
|
||||
var transport = WebClientStreamableHttpTransport
|
||||
.builder(WebClient.builder().baseUrl(baseUrl).filter(exchangeFilterFunction))
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.jsonMapper(McpJsonDefaults.getMapper())
|
||||
.openConnectionOnStartup(true)
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
|
|
@ -288,7 +288,7 @@ public class WebFluxServerTransportSecurityIntegrationTests {
|
|||
public McpSyncClient createMcpClient(String baseUrl, TestHeaderExchangeFilterFunction exchangeFilterFunction) {
|
||||
var transport = WebClientStreamableHttpTransport
|
||||
.builder(WebClient.builder().baseUrl(baseUrl).filter(exchangeFilterFunction))
|
||||
.jsonMapper(McpJsonDefaults.getDefaultMcpJsonMapper())
|
||||
.jsonMapper(McpJsonDefaults.getMapper())
|
||||
.openConnectionOnStartup(true)
|
||||
.build();
|
||||
return McpClient.sync(transport).initializationTimeout(Duration.ofMillis(500)).build();
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ public final class McpJsonMapperUtils {
|
|||
private McpJsonMapperUtils() {
|
||||
}
|
||||
|
||||
public static final McpJsonMapper JSON_MAPPER = McpJsonDefaults.getDefaultMcpJsonMapper();
|
||||
public static final McpJsonMapper JSON_MAPPER = McpJsonDefaults.getMapper();
|
||||
|
||||
}
|
||||
Loading…
Reference in a new issue