Remove duplicate deprecated spec.JsonSchemaValidator (#666)#988
Open
k-krawczyk wants to merge 1 commit into
Open
Remove duplicate deprecated spec.JsonSchemaValidator (#666)#988k-krawczyk wants to merge 1 commit into
k-krawczyk wants to merge 1 commit into
Conversation
…tocol#666) There were two JsonSchemaValidator types in the codebase: io.modelcontextprotocol.spec.JsonSchemaValidator (deprecated) and io.modelcontextprotocol.json.schema.JsonSchemaValidator (the one in use). As noted by a maintainer in the issue, the deprecated one in the spec package should be removed. It was already annotated @deprecated pointing to the json.schema variant, and nothing references it: no imports, no fully-qualified usages, and no wildcard imports of the spec package resolve to it. All production and test code already uses io.modelcontextprotocol.json.schema.JsonSchemaValidator. Fixes modelcontextprotocol#666
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #666.
The codebase had two
JsonSchemaValidatortypes:io.modelcontextprotocol.spec.JsonSchemaValidator— already@Deprecated, pointing to the one belowio.modelcontextprotocol.json.schema.JsonSchemaValidator— the one actually in useAs noted by @chemicL in the issue, the deprecated one in the
specpackage should be removed. This PR deletes it.Verification that it is unused
The removed interface is dead code:
io.modelcontextprotocol.spec.JsonSchemaValidator.spec.JsonSchemaValidatorusages anywhere (mainortest).specpackage that could resolve to it.specpackage itself (e.g.McpServerSession,McpStreamableServerSession,DefaultMcpStreamableServerSessionFactory) explicitly importio.modelcontextprotocol.json.schema.JsonSchemaValidator.All production and test code already uses
io.modelcontextprotocol.json.schema.JsonSchemaValidator.Testing
./mvnw -pl mcp-core,mcp-json-jackson2,mcp-json-jackson3 -am test-compile— passes (full main + test compile across the core modules)../mvnw -pl mcp-core -am test -Dtest=ToolInputValidatorTests,McpAsyncServerExchangeTests— passes (validator-related tests).