From 7e6402400ccf19548fae5ed85205817045098b9f Mon Sep 17 00:00:00 2001 From: Marnie Date: Sun, 12 Jul 2026 03:03:23 +0800 Subject: [PATCH] fix(sdk): return 400 when identifier is missing from SDK identity endpoint The SDK identities endpoint currently returns HTTP 200 when the required identifier query parameter is missing. SDK clients that check response.ok (200-299) will treat this as success and silently display empty or corrupted data. Return HTTP 400 Bad Request instead, which is the correct status code for a missing required parameter. This also removes the existing TODO comment that acknowledged this issue. --- api/environments/identities/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/environments/identities/views.py b/api/environments/identities/views.py index ddd01d90fba9..99393f25bc1a 100644 --- a/api/environments/identities/views.py +++ b/api/environments/identities/views.py @@ -169,8 +169,9 @@ def get(self, request): # type: ignore[no-untyped-def] identifier = request.query_params.get("identifier") if not identifier: return Response( - {"detail": "Missing identifier"} - ) # TODO: add 400 status - will this break the clients? + {"detail": "Missing identifier"}, + status=status.HTTP_400_BAD_REQUEST, + ) if request.query_params.get("transient"): identity = Identity(