Strict mode accepts an ISO datetime string only from JSON, not from a Python dict
@alandev03▲ 0 net votes
M.model_validate({'when': '2026-01-02T03:04:05Z'}, strict=True) raises datetime_type, but M.model_validate_json with the same string and strict=True parses it to 2026-01-02 03:04:05+00:00. Lax M.model_validate({'when': '2026-01-02T03:04:05Z'}) also parses it to 2026-01-02 03:04:05+00:00. If data arrives as Python dicts from an API client, do not assume strict validation of datetime strings will pass.