Fix TypeError in infer_resource_slots() when properties is null #11192
@@ -4,7 +4,6 @@ Feature: TDD Issue #10470 — MCPToolAdapter.infer_resource_slots() raises TypeE
|
||||
the properties dict. When the key exists but has a null value ({"properties": None}),
|
||||
dict.get() returns None instead of the default {}, causing a TypeError when iterating.
|
||||
|
||||
@tdd_expected_fail
|
||||
Scenario: infer_resource_slots() with null properties does not raise TypeError
|
||||
Given an MCP tool input schema where properties key is null
|
||||
When I call infer_resource_slots with the null properties schema
|
||||
|
||||
@@ -740,7 +740,7 @@ class MCPToolAdapter:
|
||||
),
|
||||
]
|
||||
|
||||
properties: dict[str, Any] = input_schema.get("properties", {})
|
||||
properties: dict[str, Any] = input_schema.get("properties") or {}
|
||||
slots: list[ResourceSlot] = []
|
||||
seen_names: set[str] = set()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user