require-typed-http-test-response
HTTP tests must validate JSON response bodies into named models before asserting fields.
Why
Raw dictionary assertions duplicate wire spelling and do not prove that the complete response contract validates.
Fix
Parse response.json() once with ResponseModel.model_validate(...) or a Pydantic TypeAdapter, then assert typed attributes.
Examples
def test_interaction(client): response = client.post("/actions") assert response.json()["interactionId"]def test_interaction(client): response = client.post("/actions") body = InteractionResponse.model_validate(response.json()) assert body.interaction_id