phase 1
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user