Skip to content

ref(api): type nullable fields in the base group serializer#116068

Merged
cvxluo merged 1 commit into
masterfrom
cvxluo/make-shareid-and-assignedto-nullable-in-basegroups
May 23, 2026
Merged

ref(api): type nullable fields in the base group serializer#116068
cvxluo merged 1 commit into
masterfrom
cvxluo/make-shareid-and-assignedto-nullable-in-basegroups

Conversation

@cvxluo
Copy link
Copy Markdown
Contributor

@cvxluo cvxluo commented May 21, 2026

For unshared / unassigned issues, the actual response from the API for endpoints using the BaseGroupSerializerResponse was null. Type that correctly in the serializer

…Response

Both fields are returned as None at runtime for unshared and unassigned

issues, but the TypedDict declared them as non-nullable. Aligns the type

with reality. Surfaced by an apidocs schema validation failure on the

group details endpoint.


Also propagates the nullability to StreamGroupSerializerSnubaResponse,

which spreads the base response shape into itself.


Co-authored-by: Claude <noreply@anthropic.com>
@cvxluo cvxluo force-pushed the cvxluo/make-shareid-and-assignedto-nullable-in-basegroups branch from 8ff49d2 to b3b5759 Compare May 21, 2026 23:04
id: str
# from base response
shareId: NotRequired[str]
shareId: NotRequired[str | None]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this type is a little confusing — it is because shareId could be None, if the requester asked for shareId but it didn't exist, or the shareId key could be absent from the response entirely, if the requester asked to collapse shareId. i figure it would be best to be consistent with what the actual return type is, even though this type becomes more confusing

@cvxluo cvxluo marked this pull request as ready for review May 21, 2026 23:10
@cvxluo cvxluo requested a review from a team as a code owner May 21, 2026 23:10
@cvxluo cvxluo requested a review from a team May 21, 2026 23:10
@cvxluo cvxluo merged commit 70b73f9 into master May 23, 2026
65 of 66 checks passed
@cvxluo cvxluo deleted the cvxluo/make-shareid-and-assignedto-nullable-in-basegroups branch May 23, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants