MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / parse_obj

Function parse_obj

src/opencode_ai/_compat.py:79–83  ·  view source on GitHub ↗
(model: type[_ModelT], value: object)

Source from the content-addressed store, hash-verified

77
78# renamed methods / properties
79def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
80 if PYDANTIC_V2:
81 return model.model_validate(value)
82 else:
83 return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
84
85
86def field_is_required(field: FieldInfo) -> bool:

Callers 4

test_iso8601_datetimeFunction · 0.90
test_deprecated_aliasFunction · 0.90
validate_typeFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_iso8601_datetimeFunction · 0.72
test_deprecated_aliasFunction · 0.72