This commit is contained in:
2026-03-23 09:58:40 -03:00
parent 9c9c7dff09
commit 8186bb5fe6
40 changed files with 3996 additions and 17 deletions

View File

@@ -44,6 +44,17 @@ def get_list_inner(type_hint: Any) -> str:
return "str"
def is_dataclass_type(type_hint: Any) -> bool:
"""Check if type is a dataclass (nested model reference)."""
return isinstance(type_hint, type) and dc.is_dataclass(type_hint)
def get_list_inner_type(type_hint: Any) -> Any:
"""Get the raw inner type of List[T] (not stringified)."""
args = get_args(type_hint)
return args[0] if args else None
def get_field_default(field: dc.Field) -> Any:
"""Get default value from dataclass field."""
if field.default is not dc.MISSING: