Skip to content

Remove duplicate deprecated spec.JsonSchemaValidator (#666)#988

Open
k-krawczyk wants to merge 1 commit into
modelcontextprotocol:mainfrom
k-krawczyk:fix/remove-duplicate-jsonschemavalidator-666
Open

Remove duplicate deprecated spec.JsonSchemaValidator (#666)#988
k-krawczyk wants to merge 1 commit into
modelcontextprotocol:mainfrom
k-krawczyk:fix/remove-duplicate-jsonschemavalidator-666

Conversation

@k-krawczyk
Copy link
Copy Markdown

Summary

Fixes #666.

The codebase had two JsonSchemaValidator types:

  • io.modelcontextprotocol.spec.JsonSchemaValidator — already @Deprecated, pointing to the one below
  • io.modelcontextprotocol.json.schema.JsonSchemaValidator — the one actually in use

As noted by @chemicL in the issue, the deprecated one in the spec package should be removed. This PR deletes it.

Verification that it is unused

The removed interface is dead code:

  • No file imports io.modelcontextprotocol.spec.JsonSchemaValidator.
  • No fully-qualified spec.JsonSchemaValidator usages anywhere (main or test).
  • No wildcard imports of the spec package that could resolve to it.
  • Files in the spec package itself (e.g. McpServerSession, McpStreamableServerSession, DefaultMcpStreamableServerSessionFactory) explicitly import io.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).

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There are two JsonSchemaValidator

1 participant