Skip to content

feat: Add form and url field modeling to Elicitation capability - #1

Merged
overheadhunter merged 1 commit into
overheadhunter:fix-724from
rhtnr:add-elicitation-fields
Jan 8, 2026
Merged

overheadhunter merged 1 commit into
overheadhunter:fix-724from
rhtnr:add-elicitation-fields

Conversation

@rhtnr

@rhtnr rhtnr commented Jan 7, 2026

Copy link
Copy Markdown

Summary

Builds on top of your @JsonIgnoreProperties(ignoreUnknown = true) fix by adding proper field modeling for form and url per the 2025-11-25 spec.

Changes

  • Added nested Form and Url records to Elicitation with proper Jackson annotations
  • Kept @JsonIgnoreProperties(ignoreUnknown = true) on all records for future-proofing
  • Added no-arg constructor for backward compatibility
  • Added elicitation(boolean form, boolean url) builder method for explicit control
  • Added 7 comprehensive tests
  • Updated testParseInitializeRequest to expect correct parsed values

Benefits of Combined Approach

Feature @JsonIgnoreProperties only + Field modeling
Ignores unknown fields ✅ ✅
Properly parses form/url ❌ ✅
Builder support for form/url ❌ ✅
Serializes form/url correctly ❌ ✅
Future-proof for new fields ✅ ✅

Test plan

  • All 83 McpSchemaTests pass
  • Backward compatible with empty elicitation object

…1-25 spec

Update the ClientCapabilities.Elicitation record to accept optional "form"
and "url" fields as defined in the MCP 2025-11-25 specification.

Previously, deserializing an InitializeRequest with
`{"capabilities":{"elicitation":{"form":{}}}}` would fail with
UnrecognizedPropertyException because the Elicitation record was empty.

Changes:
- Add nested Form and Url marker records to Elicitation
- Add no-arg constructor for backward compatibility (serializes to {})
- Add elicitation(boolean form, boolean url) builder method
- Add comprehensive tests for deserialization and serialization

Fixes modelcontextprotocol#724
@overheadhunter
overheadhunter merged commit 806048e into overheadhunter:fix-724 Jan 8, 2026
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.

2 participants