fix(codegen): preserve equivalent suffixed type references - #48024
Merged
Conversation
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
Fix Effect client type generation when an encoded schema and a normal optional schema contain equivalent named types.
Schema representation can assign a numeric suffix to one occurrence (for example
Message_State_1). The Effect emitter previously only matched exact registered names, so it expanded that occurrence inline instead of preserving the authoritative type reference.This is a standalone generator fix extracted from #48005. It contains only generator implementation and tests; it does not depend on the fork API changes.
Verification
packages/httpapi-codegen:bun test test/generate.test.ts— 90 passingpackages/httpapi-codegen:bun typecheckpackages/client:bun run check:generated— passes without changes to generated baseline files