From f1747079c85989cbcb7082a7a129519e31989b77 Mon Sep 17 00:00:00 2001 From: Qubasa Date: Tue, 14 Oct 2025 11:30:48 +0200 Subject: [PATCH] clan_cli: Add typeAlias support for api.py --- pkgs/clan-cli/clan_lib/api/type_to_jsonschema.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/clan-cli/clan_lib/api/type_to_jsonschema.py b/pkgs/clan-cli/clan_lib/api/type_to_jsonschema.py index b4dda26a1..04bd49de6 100644 --- a/pkgs/clan-cli/clan_lib/api/type_to_jsonschema.py +++ b/pkgs/clan-cli/clan_lib/api/type_to_jsonschema.py @@ -13,6 +13,7 @@ from typing import ( NewType, NotRequired, Required, + TypeAliasType, TypeVar, Union, get_args, @@ -239,6 +240,12 @@ def type_to_dict( origtype = t.__supertype__ return type_to_dict(origtype, scope, type_map) + if isinstance(t, TypeAliasType): + # Handle PEP 695 type aliases (type X = Y syntax) + return type_to_dict( + t.__value__, scope, type_map, narrow_unsupported_union_types + ) + if hasattr(t, "__origin__"): # Check if it's a generic type origin = get_origin(t) args = get_args(t)