mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +02:00
When a tool returns `list[dict]`, the client deserializes each dict as a `Root()` dataclass with no fields instead of preserving the original dict data. The root cause is in `_get_from_type_handler`: its `"object"` branch always fell through to `_create_dataclass` for schemas without `properties`, creating an empty dataclass named `Root`. The top-level `json_schema_to_type` already handled this case correctly (returning `dict[str, Any]`), but that logic was not shared with `_schema_to_type` which is used when converting nested schemas (e.g., array items). Extract `_object_schema_to_type` to unify the four object-schema cases (dict, typed dict, BaseModel with extra, dataclass) so both top-level and nested paths produce the correct type. Fixes #3867 Co-authored-by: Ke Wang <ke@pika.art> |
||
|---|---|---|
| .. | ||
| auth | ||
| client | ||
| sampling | ||
| tasks | ||
| telemetry | ||
| transports | ||
| __init__.py | ||
| test_elicitation.py | ||
| test_elicitation_enums.py | ||
| test_logs.py | ||
| test_notifications.py | ||
| test_oauth_callback_race.py | ||
| test_oauth_callback_xss.py | ||
| test_openapi.py | ||
| test_progress.py | ||
| test_roots.py | ||
| test_sampling.py | ||
| test_sampling_result_types.py | ||
| test_sampling_tool_loop.py | ||
| test_sse.py | ||
| test_stdio.py | ||
| test_streamable_http.py | ||