@@ -176,6 +176,7 @@ public sealed interface JSONRPCMessage permits JSONRPCRequest, JSONRPCNotificati
176
176
}
177
177
178
178
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
179
+ @ JsonIgnoreProperties (ignoreUnknown = true )
179
180
public record JSONRPCRequest ( // @formatter:off
180
181
@ JsonProperty ("jsonrpc" ) String jsonrpc ,
181
182
@ JsonProperty ("method" ) String method ,
@@ -184,20 +185,23 @@ public record JSONRPCRequest( // @formatter:off
184
185
} // @formatter:on
185
186
186
187
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
188
+ @ JsonIgnoreProperties (ignoreUnknown = true )
187
189
public record JSONRPCNotification ( // @formatter:off
188
190
@ JsonProperty ("jsonrpc" ) String jsonrpc ,
189
191
@ JsonProperty ("method" ) String method ,
190
192
@ JsonProperty ("params" ) Map <String , Object > params ) implements JSONRPCMessage {
191
193
} // @formatter:on
192
194
193
195
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
196
+ @ JsonIgnoreProperties (ignoreUnknown = true )
194
197
public record JSONRPCResponse ( // @formatter:off
195
198
@ JsonProperty ("jsonrpc" ) String jsonrpc ,
196
199
@ JsonProperty ("id" ) Object id ,
197
200
@ JsonProperty ("result" ) Object result ,
198
201
@ JsonProperty ("error" ) JSONRPCError error ) implements JSONRPCMessage {
199
202
200
203
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
204
+ @ JsonIgnoreProperties (ignoreUnknown = true )
201
205
public record JSONRPCError (
202
206
@ JsonProperty ("code" ) int code ,
203
207
@ JsonProperty ("message" ) String message ,
@@ -209,6 +213,7 @@ public record JSONRPCError(
209
213
// Initialization
210
214
// ---------------------------
211
215
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
216
+ @ JsonIgnoreProperties (ignoreUnknown = true )
212
217
public record InitializeRequest ( // @formatter:off
213
218
@ JsonProperty ("protocolVersion" ) String protocolVersion ,
214
219
@ JsonProperty ("capabilities" ) ClientCapabilities capabilities ,
@@ -239,6 +244,7 @@ public record InitializeResult( // @formatter:off
239
244
*
240
245
*/
241
246
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
247
+ @ JsonIgnoreProperties (ignoreUnknown = true )
242
248
public record ClientCapabilities ( // @formatter:off
243
249
@ JsonProperty ("experimental" ) Map <String , Object > experimental ,
244
250
@ JsonProperty ("roots" ) RootCapabilities roots ,
@@ -253,7 +259,8 @@ public record ClientCapabilities( // @formatter:off
253
259
* @param listChanged Whether the client would send notification about roots
254
260
* has changed since the last time the server checked.
255
261
*/
256
- @ JsonInclude (JsonInclude .Include .NON_ABSENT )
262
+ @ JsonInclude (JsonInclude .Include .NON_ABSENT )
263
+ @ JsonIgnoreProperties (ignoreUnknown = true )
257
264
public record RootCapabilities (
258
265
@ JsonProperty ("listChanged" ) Boolean listChanged ) {
259
266
}
@@ -303,6 +310,7 @@ public ClientCapabilities build() {
303
310
}// @formatter:on
304
311
305
312
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
313
+ @ JsonIgnoreProperties (ignoreUnknown = true )
306
314
public record ServerCapabilities ( // @formatter:off
307
315
@ JsonProperty ("experimental" ) Map <String , Object > experimental ,
308
316
@ JsonProperty ("logging" ) LoggingCapabilities logging ,
@@ -375,6 +383,7 @@ public ServerCapabilities build() {
375
383
} // @formatter:on
376
384
377
385
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
386
+ @ JsonIgnoreProperties (ignoreUnknown = true )
378
387
public record Implementation (// @formatter:off
379
388
@ JsonProperty ("name" ) String name ,
380
389
@ JsonProperty ("version" ) String version ) {
@@ -413,6 +422,7 @@ public interface Annotated {
413
422
* optional. It is a number between 0 and 1.
414
423
*/
415
424
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
425
+ @ JsonIgnoreProperties (ignoreUnknown = true )
416
426
public record Annotations ( // @formatter:off
417
427
@ JsonProperty ("audience" ) List <Role > audience ,
418
428
@ JsonProperty ("priority" ) Double priority ) {
@@ -458,6 +468,7 @@ public record Resource( // @formatter:off
458
468
* @see <a href="https://datatracker.ietf.org/doc/html/rfc6570">RFC 6570</a>
459
469
*/
460
470
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
471
+ @ JsonIgnoreProperties (ignoreUnknown = true )
461
472
public record ResourceTemplate ( // @formatter:off
462
473
@ JsonProperty ("uriTemplate" ) String uriTemplate ,
463
474
@ JsonProperty ("name" ) String name ,
@@ -481,6 +492,7 @@ public record ListResourceTemplatesResult( // @formatter:off
481
492
} // @formatter:on
482
493
483
494
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
495
+ @ JsonIgnoreProperties (ignoreUnknown = true )
484
496
public record ReadResourceRequest ( // @formatter:off
485
497
@ JsonProperty ("uri" ) String uri ){
486
498
} // @formatter:on
@@ -499,11 +511,13 @@ public record ReadResourceResult( // @formatter:off
499
511
* it is up to the server how to interpret it.
500
512
*/
501
513
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
514
+ @ JsonIgnoreProperties (ignoreUnknown = true )
502
515
public record SubscribeRequest ( // @formatter:off
503
516
@ JsonProperty ("uri" ) String uri ){
504
517
} // @formatter:on
505
518
506
519
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
520
+ @ JsonIgnoreProperties (ignoreUnknown = true )
507
521
public record UnsubscribeRequest ( // @formatter:off
508
522
@ JsonProperty ("uri" ) String uri ){
509
523
} // @formatter:on
@@ -574,6 +588,7 @@ public record BlobResourceContents( // @formatter:off
574
588
* @param arguments A list of arguments to use for templating the prompt.
575
589
*/
576
590
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
591
+ @ JsonIgnoreProperties (ignoreUnknown = true )
577
592
public record Prompt ( // @formatter:off
578
593
@ JsonProperty ("name" ) String name ,
579
594
@ JsonProperty ("description" ) String description ,
@@ -588,6 +603,7 @@ public record Prompt( // @formatter:off
588
603
* @param required Whether this argument must be provided.
589
604
*/
590
605
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
606
+ @ JsonIgnoreProperties (ignoreUnknown = true )
591
607
public record PromptArgument ( // @formatter:off
592
608
@ JsonProperty ("name" ) String name ,
593
609
@ JsonProperty ("description" ) String description ,
@@ -604,6 +620,7 @@ public record PromptArgument( // @formatter:off
604
620
* @param content The content of the message of type {@link Content}.
605
621
*/
606
622
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
623
+ @ JsonIgnoreProperties (ignoreUnknown = true )
607
624
public record PromptMessage ( // @formatter:off
608
625
@ JsonProperty ("role" ) Role role ,
609
626
@ JsonProperty ("content" ) Content content ) {
@@ -630,6 +647,7 @@ public record ListPromptsResult( // @formatter:off
630
647
* @param arguments Arguments to use for templating the prompt.
631
648
*/
632
649
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
650
+ @ JsonIgnoreProperties (ignoreUnknown = true )
633
651
public record GetPromptRequest (// @formatter:off
634
652
@ JsonProperty ("name" ) String name ,
635
653
@ JsonProperty ("arguments" ) Map <String , Object > arguments ) implements Request {
@@ -667,7 +685,7 @@ public record ListToolsResult( // @formatter:off
667
685
668
686
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
669
687
@ JsonIgnoreProperties (ignoreUnknown = true )
670
- record JsonSchema ( // @formatter:off
688
+ public record JsonSchema ( // @formatter:off
671
689
@ JsonProperty ("type" ) String type ,
672
690
@ JsonProperty ("properties" ) Map <String , Object > properties ,
673
691
@ JsonProperty ("required" ) List <String > required ,
@@ -688,6 +706,7 @@ record JsonSchema( // @formatter:off
688
706
* arguments before sending them to the server.
689
707
*/
690
708
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
709
+ @ JsonIgnoreProperties (ignoreUnknown = true )
691
710
public record Tool ( // @formatter:off
692
711
@ JsonProperty ("name" ) String name ,
693
712
@ JsonProperty ("description" ) String description ,
@@ -742,6 +761,7 @@ public record CallToolResult( // @formatter:off
742
761
// Sampling Interfaces
743
762
// ---------------------------
744
763
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
764
+ @ JsonIgnoreProperties (ignoreUnknown = true )
745
765
public record ModelPreferences (// @formatter:off
746
766
@ JsonProperty ("hints" ) List <ModelHint > hints ,
747
767
@ JsonProperty ("costPriority" ) Double costPriority ,
@@ -750,17 +770,20 @@ public record ModelPreferences(// @formatter:off
750
770
} // @formatter:on
751
771
752
772
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
773
+ @ JsonIgnoreProperties (ignoreUnknown = true )
753
774
public record ModelHint (@ JsonProperty ("name" ) String name ) {
754
775
}
755
776
756
777
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
778
+ @ JsonIgnoreProperties (ignoreUnknown = true )
757
779
public record SamplingMessage (// @formatter:off
758
780
@ JsonProperty ("role" ) Role role ,
759
781
@ JsonProperty ("content" ) Content content ) {
760
782
} // @formatter:on
761
783
762
784
// Sampling and Message Creation
763
785
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
786
+ @ JsonIgnoreProperties (ignoreUnknown = true )
764
787
public record CreateMessageRequest (// @formatter:off
765
788
@ JsonProperty ("messages" ) List <SamplingMessage > messages ,
766
789
@ JsonProperty ("modelPreferences" ) ModelPreferences modelPreferences ,
@@ -837,6 +860,7 @@ public CreateMessageResult build() {
837
860
// Pagination Interfaces
838
861
// ---------------------------
839
862
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
863
+ @ JsonIgnoreProperties (ignoreUnknown = true )
840
864
public record PaginatedRequest (@ JsonProperty ("cursor" ) String cursor ) {
841
865
}
842
866
@@ -848,6 +872,7 @@ public record PaginatedResult(@JsonProperty("nextCursor") String nextCursor) {
848
872
// ---------------------------
849
873
// Progress and Logging
850
874
// ---------------------------
875
+ @ JsonIgnoreProperties (ignoreUnknown = true )
851
876
public record ProgressNotification (// @formatter:off
852
877
@ JsonProperty ("progressToken" ) String progressToken ,
853
878
@ JsonProperty ("progress" ) double progress ,
@@ -864,6 +889,7 @@ public record ProgressNotification(// @formatter:off
864
889
* @param logger The logger that generated the message.
865
890
* @param data JSON-serializable logging data.
866
891
*/
892
+ @ JsonIgnoreProperties (ignoreUnknown = true )
867
893
public record LoggingMessageNotification (// @formatter:off
868
894
@ JsonProperty ("level" ) LoggingLevel level ,
869
895
@ JsonProperty ("logger" ) String logger ,
@@ -980,6 +1006,7 @@ else if (this instanceof EmbeddedResource) {
980
1006
}
981
1007
982
1008
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
1009
+ @ JsonIgnoreProperties (ignoreUnknown = true )
983
1010
public record TextContent ( // @formatter:off
984
1011
@ JsonProperty ("audience" ) List <Role > audience ,
985
1012
@ JsonProperty ("priority" ) Double priority ,
@@ -991,6 +1018,7 @@ public TextContent(String content) {
991
1018
}
992
1019
993
1020
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
1021
+ @ JsonIgnoreProperties (ignoreUnknown = true )
994
1022
public record ImageContent ( // @formatter:off
995
1023
@ JsonProperty ("audience" ) List <Role > audience ,
996
1024
@ JsonProperty ("priority" ) Double priority ,
@@ -999,6 +1027,7 @@ public record ImageContent( // @formatter:off
999
1027
}
1000
1028
1001
1029
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
1030
+ @ JsonIgnoreProperties (ignoreUnknown = true )
1002
1031
public record EmbeddedResource ( // @formatter:off
1003
1032
@ JsonProperty ("audience" ) List <Role > audience ,
1004
1033
@ JsonProperty ("priority" ) Double priority ,
@@ -1019,6 +1048,7 @@ public record EmbeddedResource( // @formatter:off
1019
1048
* for referencing the root in other parts of the application.
1020
1049
*/
1021
1050
@ JsonInclude (JsonInclude .Include .NON_ABSENT )
1051
+ @ JsonIgnoreProperties (ignoreUnknown = true )
1022
1052
public record Root ( // @formatter:off
1023
1053
@ JsonProperty ("uri" ) String uri ,
1024
1054
@ JsonProperty ("name" ) String name ) {
0 commit comments