Skip to content

Commit 9bf4599

Browse files
authored
fix: preserve JSON Schema 2020-12 keywords (#1018)
1 parent 7044ccf commit 9bf4599

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

conformance/expected-failures-2026-07-28.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
# When bumping DRAFT_CONFORMANCE_VERSION, diff
1010
# `conformance list --spec-version 2026-07-28` and update #977.
1111

12-
server:
13-
# SEP-2106: composition/conditional/$anchor keywords are stripped from
14-
# published tool input schemas.
15-
# tracked in #1003
16-
- json-schema-2020-12
12+
server: []
1713

1814
client:
1915
# Client does not yet send MCP-Protocol-Version header pre-initialize as

conformance/src/bin/server.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ impl ServerHandler for ConformanceServer {
556556
"type": "object",
557557
"$defs": {
558558
"address": {
559+
"$anchor": "address",
559560
"type": "object",
560561
"properties": {
561562
"street": { "type": "string" },
@@ -567,6 +568,19 @@ impl ServerHandler for ConformanceServer {
567568
"name": { "type": "string" },
568569
"address": { "$ref": "#/$defs/address" }
569570
},
571+
"allOf": [{
572+
"anyOf": [
573+
{ "required": ["name"] },
574+
{ "required": ["address"] }
575+
]
576+
}],
577+
"if": { "required": ["address"] },
578+
"then": {
579+
"properties": {
580+
"address": { "required": ["street"] }
581+
}
582+
},
583+
"else": { "required": ["name"] },
570584
"additionalProperties": false
571585
})),
572586
),

0 commit comments

Comments
 (0)