Commit 37a9f3a
Add @JsonIgnoreProperties(ignoreUnknown = true) to capability sub-records
The top-level ClientCapabilities and ServerCapabilities records have
@JsonIgnoreProperties(ignoreUnknown = true) but their nested sub-records
do not. Since ObjectMapper defaults to FAIL_ON_UNKNOWN_PROPERTIES = true,
unknown fields on sub-objects cause deserialization failures.
This already caused a real breakage when elicitation gained form/url
fields (#724). The MCP spec explicitly does not close capability objects
(additionalProperties is never set to false), so SDKs must tolerate
unknown fields for forward compatibility.
Add the annotation to:
- ClientCapabilities.Sampling
- ClientCapabilities.Elicitation, Elicitation.Form, Elicitation.Url
- ServerCapabilities.CompletionCapabilities
- ServerCapabilities.LoggingCapabilities
- ServerCapabilities.PromptCapabilities
- ServerCapabilities.ResourceCapabilities
- ServerCapabilities.ToolCapabilities
Fixes #766
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 26304a7 commit 37a9f3a
2 files changed
Lines changed: 80 additions & 0 deletions
File tree
- mcp-core/src/main/java/io/modelcontextprotocol/spec
- mcp-test/src/test/java/io/modelcontextprotocol/spec
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
| |||
431 | 432 | | |
432 | 433 | | |
433 | 434 | | |
| 435 | + | |
434 | 436 | | |
435 | 437 | | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
439 | 441 | | |
| 442 | + | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
443 | 446 | | |
444 | 447 | | |
445 | 448 | | |
446 | 449 | | |
| 450 | + | |
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
| |||
542 | 546 | | |
543 | 547 | | |
544 | 548 | | |
| 549 | + | |
545 | 550 | | |
546 | 551 | | |
547 | 552 | | |
548 | 553 | | |
549 | 554 | | |
550 | 555 | | |
551 | 556 | | |
| 557 | + | |
552 | 558 | | |
553 | 559 | | |
554 | 560 | | |
| |||
559 | 565 | | |
560 | 566 | | |
561 | 567 | | |
| 568 | + | |
562 | 569 | | |
563 | 570 | | |
564 | 571 | | |
| |||
570 | 577 | | |
571 | 578 | | |
572 | 579 | | |
| 580 | + | |
573 | 581 | | |
574 | 582 | | |
575 | 583 | | |
| |||
581 | 589 | | |
582 | 590 | | |
583 | 591 | | |
| 592 | + | |
584 | 593 | | |
585 | 594 | | |
586 | 595 | | |
| |||
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1760 | 1760 | | |
1761 | 1761 | | |
1762 | 1762 | | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1763 | 1834 | | |
0 commit comments