fix ty check failures exposed by newer version

This commit is contained in:
Danglewood
2026-07-22 11:48:28 -07:00
parent 80634fe604
commit a07534cfa4
4 changed files with 23 additions and 13 deletions

View File

@@ -377,14 +377,16 @@ def _quick_schema_type(schema: dict[str, Any]) -> str:
if schema_type == "object" or "properties" in schema:
title = schema.get("title")
return title or "object"
if schema_type in _PRIMITIVE_TYPES:
if schema_type == "string":
fmt = schema.get("format")
if fmt == "date":
return "date"
if fmt == "date-time":
return "datetime"
return _PRIMITIVE_TYPES[schema_type]
if isinstance(schema_type, str):
primitive_type = _PRIMITIVE_TYPES.get(schema_type)
if primitive_type is not None:
if schema_type == "string":
fmt = schema.get("format")
if fmt == "date":
return "date"
if fmt == "date-time":
return "datetime"
return primitive_type
return "Any"