fix(token_counter): avoid new unknown type diagnostics

Assisted-by: OpenAI Codex
This commit is contained in:
dlowzzxx 2026-10-14 11:00:52 +02:00
parent 7858fb9569
commit d2160f155d

View file

@ -1112,9 +1112,8 @@ def _format_type(props, indent):
return " | ".join([f'"{item}"' for item in props["enum"]])
return "string"
elif type == "array":
items: Final = props.get("items")
if isinstance(items, dict):
return f"{_format_type(items, indent)}[]"
if "items" in props and isinstance(props["items"], dict):
return f"{_format_type(props['items'], indent)}[]"
return "any[]"
elif type == "object":
return f"{{\n{_format_object_parameters(props, indent + 2)}\n}}"