Skip to content

ref: Type 12 PUBLIC endpoints via local error TypedDicts and serializer typing#117252

Merged
azulus merged 2 commits into
masterfrom
jeremy/type-public-error-shapes
Jun 9, 2026
Merged

ref: Type 12 PUBLIC endpoints via local error TypedDicts and serializer typing#117252
azulus merged 2 commits into
masterfrom
jeremy/type-public-error-shapes

Conversation

@azulus

@azulus azulus commented Jun 9, 2026

Copy link
Copy Markdown
Member

Tightens 12 more PUBLIC endpoints across 9 files:

  • sentry_app_details delete: new local _PublishedAppErrorResponse for {"detail": list[str]} shape
  • project_symbol_sources get/post/put/delete: new local _SymbolSourceErrorResponse for {"error": str} envelope + _SymbolSource TypeAlias for variable source-dict shape
  • organization_projects post: new local _OrganizationProjectCreateResponse extending OrganizationProjectResponse with team_slug
  • organization_dashboards post: typed against existing DashboardDetailsResponse plus a Response[str] arm for raw-string error bodies retained for backward compat
  • release_deploys get + post: typed Deploy serializer with new DeploySerializerResponse TypedDict
  • notification_actions_index get + post and notification_actions_details get + put: typed OutgoingNotificationActionSerializer with new OutgoingNotificationActionResponse TypedDict

Validation paths route through as_validation_errors(). No body changes.

scim/teams.patch is excluded — its SCIM error envelope path passes exception.detail through directly, which mypy can't structurally match against an SCIMErrorResponse arm without restructuring the method.

…er typing

Tightens 12 more PUBLIC endpoints across 9 files:

- sentry_app_details delete: new local _PublishedAppErrorResponse for
  `{"detail": list[str]}` shape
- project_symbol_sources get/post/put/delete: new local
  _SymbolSourceErrorResponse for `{"error": str}` envelope + _SymbolSource
  TypeAlias for variable source-dict shape
- organization_projects post: new local _OrganizationProjectCreateResponse
  extending OrganizationProjectResponse with `team_slug` to surface the
  auto-created personal team
- organization_dashboards post: typed against existing DashboardDetailsResponse
  plus a `Response[str]` arm for the raw-string error bodies retained for
  backward compat
- release_deploys get + post: typed Deploy serializer with new
  DeploySerializerResponse TypedDict
- notification_actions_index get + post and notification_actions_details
  get + put: typed OutgoingNotificationActionSerializer with new
  OutgoingNotificationActionResponse TypedDict

Validation paths route through as_validation_errors(). No body changes.

scim/teams.patch is excluded — its SCIM error envelope path passes
exception.detail through directly, which mypy can't structurally match
against an SCIMErrorResponse arm without restructuring the method.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 9, 2026
@azulus azulus marked this pull request as ready for review June 9, 2026 22:19
@azulus azulus requested review from a team as code owners June 9, 2026 22:19
The OpenAPI examples in NotificationActionExamples had id/organizationId
as strings and omitted integrationId/sentryAppId. The runtime serializer
emits these as integers (id, organizationId) and always emits
integrationId/sentryAppId as nullable integers. Aligning the examples to
the actual runtime resolves the api-docs-test validator failure.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@azulus azulus requested a review from a team as a code owner June 9, 2026 22:31
@azulus

azulus commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

openapi diff is intentional and brings openapi spec inline with current behavior

@azulus azulus merged commit b4e62e4 into master Jun 9, 2026
65 of 66 checks passed
@azulus azulus deleted the jeremy/type-public-error-shapes branch June 9, 2026 22:48
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