Commit db4a3ed
committed
fix: serialize ElicitRequest mode discriminator only once
ElicitRequest declares its subtype discriminator with
@JsonTypeInfo(..., property = "mode"), so Jackson already writes the mode
property during serialization. ElicitFormRequest and ElicitUrlRequest also
annotated their mode() accessor with @JsonProperty("mode"), so mode was written
twice, producing a duplicate JSON key.
Mark the overridden mode() accessors @JsonIgnore, mirroring the existing fix on
Content.type(). Deserialization is unaffected (it uses the discriminator and the
@JsonCreator factories). Adds ElicitRequestJsonTests, mirroring ContentJsonTests.1 parent ff78191 commit db4a3ed
2 files changed
Lines changed: 75 additions & 2 deletions
File tree
- mcp-core/src/main/java/io/modelcontextprotocol/spec
- mcp-test/src/test/java/io/modelcontextprotocol/spec
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4805 | 4805 | | |
4806 | 4806 | | |
4807 | 4807 | | |
4808 | | - | |
| 4808 | + | |
4809 | 4809 | | |
4810 | 4810 | | |
4811 | 4811 | | |
| |||
4931 | 4931 | | |
4932 | 4932 | | |
4933 | 4933 | | |
4934 | | - | |
| 4934 | + | |
4935 | 4935 | | |
4936 | 4936 | | |
4937 | 4937 | | |
| |||
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments