Skip to content

fix(sync): correct OpenAPI spec for sync event schemas#29224

Open
lexlian wants to merge 2 commits into
anomalyco:devfrom
lexlian:fix/sync-openapi-spec-28825
Open

fix(sync): correct OpenAPI spec for sync event schemas#29224
lexlian wants to merge 2 commits into
anomalyco:devfrom
lexlian:fix/sync-openapi-spec-28825

Conversation

@lexlian
Copy link
Copy Markdown

@lexlian lexlian commented May 25, 2026

Issue for this PR

Closes #28825

Type of change

  • Bug fix

What does this PR do?

effectPayloads() in sync/index.ts generates Effect schemas for the 33+ sync events in the OpenAPI spec. All of them used type: Literal("sync"), name: Literal(type), and aggregateID: Literal(def.aggregate) — constants that don't match what the server sends at runtime.

Changed type and aggregateID to String and removed the name field. The server emits runtime values like { type: "sync", syncEvent: { type: "session.created.1", aggregateID: "ses_1b0e...", ... } }, so the spec schemas need to accept dynamic strings rather than rejecting everything that isn't the hardcoded constant.

How did you verify your code works?

  • Added 7 tests checking that generated schemas use type: String, aggregateID: String, have no name field, and appear in the GlobalEvent payload union
  • Existing 12 tests in test/server/httpapi-public-openapi.test.ts still pass

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Change effectPayloads() to use String for type and aggregateID fields
instead of Literal constants, and remove the name field. This fixes the
OpenAPI spec mismatch (anomalyco#28825) where sync events were generated with
indistinguishable type: "sync" constants and constant aggregateID enums
that broke client-side event discrimination.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

OpenAPI spec for sync events on /global/event does not match server output

1 participant