Skip to content

Commit 9ce32f6

Browse files
fix parse_obj
1 parent 327beab commit 9ce32f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/service-library/src/servicelib/aiohttp/requests_validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def parse_request_query_parameters_as(
171171
# query parameters with the same key. However, we are not using such cases anywhere at the moment.
172172
data = dict(request.query)
173173

174-
if hasattr(parameters_schema_cls, "parse_obj"):
174+
if hasattr(parameters_schema_cls, "model_validate"):
175175
return parameters_schema_cls.model_validate(data)
176176
model: ModelClass = TypeAdapter(parameters_schema_cls).validate_python(data)
177177
return model

services/agent/tests/unit/test_api_rest__health.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
def test_health_ok(test_client: TestClient):
1515
response = test_client.get("/health")
1616
assert response.status_code == status.HTTP_200_OK
17-
assert HealthCheckGet.parse_obj(response.json())
17+
assert HealthCheckGet.model_validate(response.json())

0 commit comments

Comments
 (0)