feat: Add SEP-1034 elicitation schema default values by sainathreddyb · Pull Request #908 · modelcontextprotocol/java-sdk
Add client-side default application for elicitation schemas, matching the behavior specified in SEP-1034 and implemented in the TypeScript SDK. - Add applyDefaults field to Elicitation.Form capability record - Add applyElicitationDefaults() in McpAsyncClient to fill missing fields from schema defaults when the client returns accept with incomplete content - Add builder method elicitation(form, url, applyDefaults) - Add unit tests for applyElicitationDefaults covering all primitive types - Add schema serialization tests for applyDefaults capability - Add integration test verifying end-to-end default application flow Closes modelcontextprotocol#699
- Build new HashMap from content instead of mutating in-place, preventing UnsupportedOperationException with unmodifiable maps (Map.of()) - Add IllegalArgumentException guard when applyDefaults=true but form=false - Add Javadoc documenting applyDefaults as SDK-level behavior flag consistent with TypeScript SDK design - Add integration test for unmodifiable map content - Fix assertion to use assertThatJson node check instead of broad contains - Fix copyright year to 2024-2025
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