Skip to content

feat(go): inject protocol-level discriminators into discriminated unions#12332

Merged
fern-support merged 6 commits intomainfrom
patrick/go/sse-smart
Feb 13, 2026
Merged

feat(go): inject protocol-level discriminators into discriminated unions#12332
fern-support merged 6 commits intomainfrom
patrick/go/sse-smart

Conversation

@patrickthornton
Copy link
Contributor

Description

The Go-side part of the change started in #12242. Injects the discriminator key into the union's JSON so UnmarshalJSON can just do what it normally does. If the key is already there, injection is skipped.

I.e.,

event: completion
data: { "content": "Hello!" }

becomes

event: completion
data: { "event": "completion", "content": "Hello!" }

Changes Made

Go-v2 changes.

Testing

server-side-event-examples updated to include a protocol-level case.

  • Unit tests added/updated
  • Manual testing completed

@github-actions
Copy link
Contributor

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

@fern-support fern-support merged commit 2c500ab into main Feb 13, 2026
668 of 672 checks passed
@fern-support fern-support deleted the patrick/go/sse-smart branch February 13, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants