fix(sync): correct OpenAPI spec for sync event schemas#29224
Open
lexlian wants to merge 2 commits into
Open
Conversation
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.
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #28825
Type of change
What does this PR do?
effectPayloads()insync/index.tsgenerates Effect schemas for the 33+ sync events in the OpenAPI spec. All of them usedtype: Literal("sync"),name: Literal(type), andaggregateID: Literal(def.aggregate)— constants that don't match what the server sends at runtime.Changed
typeandaggregateIDtoStringand removed thenamefield. 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?
type: String,aggregateID: String, have nonamefield, and appear in the GlobalEvent payload uniontest/server/httpapi-public-openapi.test.tsstill passChecklist