Accept boolean sub-schemas in 2025-11-25 tool schema properties (#3354)

This commit is contained in:
Peter Alexander 2026-08-24 15:41:59 +01:00 • committed by GitHub
commit f1c40b062f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,6 +55,18 @@ SCHEMA_PATCHES: dict[str, list[tuple[str, Any, Any]]] = {
{"$ref": "#/$defs/PrimitiveSchemaDefinition"},
{},
),
# JSON Schema 2020-12 allows a boolean wherever a sub-schema is expected, and
# 2026-07-28 already leaves these free-form; accept `true`/`false` property schemas.
(
"$defs/Tool/properties/inputSchema/properties/properties/additionalProperties",
{"additionalProperties": True, "properties": {}, "type": "object"},
{"anyOf": [{"additionalProperties": True, "properties": {}, "type": "object"}, {"type": "boolean"}]},
),
(
"$defs/Tool/properties/outputSchema/properties/properties/additionalProperties",
{"additionalProperties": True, "properties": {}, "type": "object"},
{"anyOf": [{"additionalProperties": True, "properties": {}, "type": "object"}, {"type": "boolean"}]},
),
],
"2026-07-28": [
("$defs/NumberSchema/properties/default/type", "number", ["integer", "number"]),