Skip to content

Add native webhook payload unions and polling helpers#255

Merged
aenadgrleey merged 8 commits into
mainfrom
webhook-payload-unions-native-polling
Jun 6, 2026
Merged

Add native webhook payload unions and polling helpers#255
aenadgrleey merged 8 commits into
mainfrom
webhook-payload-unions-native-polling

Conversation

@aenadgrleey

@aenadgrleey aenadgrleey commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve webhook payload literal discriminators across generated SDK models
  • add webhook history examples and native polling helpers for TypeScript, Go, Python, Kotlin, C#, and Swift
  • move polling helper generation into generator backends and add a dedicated webhook-polling snapshot fixture
  • update the webhook polling guide to use the SDK polling helpers instead of a manual interval loop
  • add the 2026-06-05 update entry and release notes for SDK and generator packages

Validation

  • apps/docs: bun run generate-llms
  • packages/generator: bun run test
  • packages/generator: bun run typecheck
  • sdk/typescript: bun run typecheck
  • sdk/go/generated: go test ./...
  • sdk/python: python3 -m compileall -q generated examples/polling.py
  • sdk/kotlin/generated: ./gradlew compileKotlin -q && ./gradlew compileExamplesKotlin -q
  • sdk/csharp/generated: dotnet build --no-restore
  • sdk/swift/examples: swift build --target Polling
  • repo: bun run check:changelog

Notes

  • polling defaults to events created after startup when no explicit timestamp is provided
  • polling dedupes delivery IDs in memory and stops paging when a page contains no recent events

aenadgrleey and others added 8 commits June 5, 2026 13:42
Add webhook history examples across SDKs and teach generated webhook payload\ndeserializers to distinguish normal message deliveries from link_shared\nmessage payloads.\n\nUpdate the shared IR/spec plumbing for custom union deserializers and wire the\nGo, C#, Kotlin, Python, Swift, and TypeScript generators to use the composite\nwebhook discriminator without record-key hacks.\n\nValidation:\n- python3 -m py_compile pachca/*.py\n- bun run build\n- bun run examples/webhook-history.ts\n\nCo-authored-by: openai-codex/gpt-5.4 <openai-codex-gpt-5-4@models.pi.local>
Keep literal discriminator fields on generated union member models instead of dropping them during Kotlin and C# union emission. C# now serializes concrete override properties with the JSON field name, while Kotlin keeps secondary literal fields as body properties to avoid changing positional constructor APIs.

Also prefer the configured discriminator field when routing union decoding in Go, Python, Swift, and C# so secondary literals like event do not accidentally become the primary discriminator. Regenerated SDK outputs, generator snapshots, and release metadata.

Validation: bun --cwd packages/generator test; cd packages/generator && bun run typecheck; SDK compile/build checks for TypeScript, Python, Go, Kotlin, C#, and Swift; real main and webhook-history examples across all six SDKs.

Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Add webhook event and payload polling helpers for the generated SDK clients across TypeScript, Go, Python, Kotlin, C#, and Swift.

The helpers default to polling from startup time, dedupe delivery IDs in memory, and stop paging once they reach only-old webhook pages. Add polling examples for every SDK.

Validation run: TypeScript typecheck, Go generated tests, Python compileall, C# build, Kotlin compileKotlin, and Swift Polling target build.

Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Move the SDK webhook polling helpers into the multi-language generator so future SDK regeneration keeps the polling API in sync across TypeScript, Go, Python, Kotlin, C#, and Swift.

The generated helpers default to polling from startup time, dedupe delivery IDs in memory, expose payload polling shortcuts, and stop paging once a page contains no recent webhook events.

Validation: bun run test and bun run typecheck in packages/generator; SDK compile/typecheck checks were run earlier after regeneration.

Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Document the pending SDK and generator releases for webhook payload discriminators and native polling helpers so the changelog sync gate sees package-visible changes.

Add the 2026-06-05 product update source entry and regenerate the public update markdown and llms index from the docs generator.

Validation: bun run check:changelog.

Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Replace the webhook polling guide's manual interval loop with the generated SDK polling helpers and regenerate public markdown artifacts.

Expose the polling helper methods in generated TypeScript and Python examples.json so docs code validation recognizes guide snippets using pollWebhookEvents and poll_webhook_events.

Validation: apps/docs bun run generate-llms; packages/generator bun run test and bun run typecheck; sdk/typescript bun run typecheck; sdk/python compileall; bun run check:changelog.

Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
Add SDK example entries for webhook polling helpers across generated languages and use them in the webhook polling guide. Teach ApiCodeExample and the MDX expander to render SDK-only multi-language examples while filtering non-SDK tabs.

Commit regenerated markdown and SDK example snapshots so CI generated-sync has no drift. Ignore local .pi/tmp runtime logs so dev-server files are not accidentally staged.

Validation: bun turbo check; package generator bun test; SDK language build checks; CI=1 check-generated-sync before commit reproduced only expected uncommitted generated diffs.

Co-authored-by: openai-codex/gpt-5.5 <openai-codex-gpt-5-5@models.pi.local>
@aenadgrleey aenadgrleey force-pushed the webhook-payload-unions-native-polling branch from 4948daa to 113bb76 Compare June 6, 2026 10:42
@aenadgrleey aenadgrleey merged commit 6b6b366 into main Jun 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant