mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 20:40:13 +03:00
Fix template_list return type annotation to match _run_handler_sync envelope
template_list was annotated as dict[str, Any] but _run_handler_sync always
returns a list envelope ([{"type":"text",...}]). Other tools use
list[dict[str, Any]] consistently. This caused a Pydantic dict_type
validation error on the client.
This commit is contained in:
parent
a126f910d4
commit
ec58bea24b
@ -675,7 +675,7 @@ async def template_list(
|
||||
fields: Annotated[list[str] | None, Field(description="Response fields to include (default: [template_id, name, template_type, category, default_name_format]). "
|
||||
"Available: template_id, name, version, category, default_name_format, symbol, "
|
||||
"template_type, compute_id, usage, tags, builtin, created_at, updated_at")] = None,
|
||||
) -> dict[str, Any]:
|
||||
) -> list[dict[str, Any]]:
|
||||
"""List all available templates on the server."""
|
||||
return await asyncio.to_thread(_run_handler_sync, list_templates_handler, {"fields": fields})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user