fix(spec): DestinationUpdate discriminator, drop pagination overlay, event.data oneOf#924
Merged
Conversation
Trigger: the DestinationUpdate union lost its discriminator in 8be278c (May 2025), when `type` wasn't on PATCH. Server has since added `type` acceptance and RFC 7396 merge-patch (bd7701b), making the missing discriminator an active bug — Hookdeck's permissive `config: {}` variant greedily matched any partial-config payload, the SDK sent it through with no field remap (camelCase reached the server), and merge-patch silently no-op'd. All non-Webhook partial config updates affected. Spec: `type` becomes a required, enum-locked discriminator on every DestinationUpdate* variant; 17 new `*ConfigUpdate`/`*CredentialsUpdate` companions model the now-explicit partial PATCH shape; Hookdeck's `config: {}` removed. Impact: * Breaking for typed SDK consumers: `update()` must include `type` after regen. Server is more lenient (still accepts PATCH without `type`), so raw HTTP callers keep working but are spec-noncompliant. * SDK regen left to the bot — separate PR. CI compile-check on this PR will fail until that lands; tests were validated locally against a 1.4.1 regen. spec-sdk-tests (knock-on): `type` added to 46 update sites; paginator shape fixed (supersedes fix/spec-sdk-tests-paginator-shape); SDK retries enabled; cleanup parallelized; cleanup-error logging hardened. Test status (managed Outpost, local regen'd SDK): 133→152 passing, 14→0 failing. spec-sdk-tests have no CI today; follow-up PR will add one. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(spec-sdk): fix paginator response shape (response.result.models) Speakeasy CLI 1.741.7 → 1.753.0 (commit 3f311e0, 2026-03-13) changed the generated TS SDK return type for list operations from the flat paginated body to a PageIterator wrapper: ListEventsResponse now wraps the body in `result`, so callers access `response.result.models` instead of `response.models`. The shape change was a side-effect of the Speakeasy version bump and wasn't surfaced in the SDK regen PR changelog (which only flagged the unrelated `request` query-param restyle). Tests in spec-sdk-tests/tests/{events,tenants}.test.ts still used the pre-bump accessor and failed to compile against the current SDK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(spec-sdk): assert event.data is exposed when include=event.data Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(spec): order EventFull before EventSummary in Attempt.event oneOf Speakeasy's TS generator emits zod unions in declaration order. The non-strict EventSummary matched first and silently stripped event.data from the parsed attempt — losing the payload added by include=event.data. Declaring EventFull first lets it match when data is present, with EventSummary as the fallback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…#919) The shared pagination-config-overlay added x-speakeasy-pagination to list endpoints, which Speakeasy then converted into PageIterator wrappers (TS), res.Next() helpers (Go), and res.next() chaining (Python). In TS the wrapper changed the response shape to response.result.models, which is a noisy regression for the common single-page case. In Go and Python the helper saves one line at the cost of hiding which request params get carried across the cursor call. Drop the overlay from all three sources for symmetric, explicit DX: callers paginate manually using res.pagination.next on the flat response. SDK regeneration is intentionally left out of this commit so the workflow change can be reviewed in isolation. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…verlay drop Trigger: #919 (merged into umbrella) drops the x-speakeasy-pagination overlay, so the TS SDK no longer wraps list responses in PageIterator. events.list()/tenants.list() return EventPaginatedResult/TenantPaginatedResult directly — accessor is `response.models`, not `response.result.models`. Tests in #920 had been adapted to the wrapper shape; this realigns them back to the flat shape post-regen. Local run after fresh TS SDK regen: 153 passing / 0 failing / 15 pending. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
alexluong
approved these changes
May 29, 2026
This was referenced May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles three spec/SDK fixes that landed sequentially on the
fix/spec-sdk-fixesumbrella. The combined effect: PATCH semantics are spec-correct, TS list endpoints return flat results again, andevent.datais no longer dropped onlistAttemptswithinclude=event.data.What's in this PR
fix(openapi): add type discriminator to DestinationUpdate union*ConfigUpdate/*CredentialsUpdatecompanion schemas so partial PATCH bodies are typeable. Fixes a silent wire-serialization bug where the SDK was routing partial-config PATCH through Hookdeck's permissive variant and sending camelCase keys the server didn't recognize.fix(spec): expose event.data on Attempt when include=event.dataoneOforder soEventFullcomes beforeEventSummary. Zod'sz.unionmatches first-success and was droppingdatatoEventSummary.chore(sdks): drop x-speakeasy-pagination overlay from all SDK sourcesPageIteratorwrapper — back to a flatPromise<EventPaginatedResult>withresult.models/result.pagination. Net DX improvement; the Python auto-pagination upside that originally motivated the overlay didn't pan out symmetrically.Consumer impact (after SDK regen lands)
update()type: '<destination>'. Compile error otherwise. Discriminated narrowing means IDE autocomplete now suggests only fields valid for the chosentype.list()PageIterator.Promise<XPaginatedResult>— read fromresult.models/result.pagination. Nofor awaititeration helper.listAttempts({include: ['event.data']})attempt.eventnow includesdatainstead of dropping it silently.type(lenient). All other changes are wire-compatible.Test plan
swagger-cli validate).4675bc9c).Notes
PageIterator). The tests in this PR still referenceresponse.result.models— they'll need a follow-up commit on this branch before the local acceptance run is green.🤖 Generated with Claude Code