Conversation
…ports
In params-object mode, an operation-level x-speakeasy-exports entry on an
SSE-overloaded operation with a union-of-objects request body only exported
the base <Op>Params type. The Streaming/NonStreaming params and the
per-variant <Member>Params{,NonStreaming,Streaming} types were not
reachable from resources.ts, and the method declared no overload for the
union-level Streaming/NonStreaming params, so a value of that type resolved
to the catch-all overload and lost the narrowed stream return type.
- Methods with union bodies now also declare the union-level
NonStreaming/Streaming overloads, after the per-variant ones.
- Every SSE operation export goes through one path: its Streaming and
NonStreaming params are added after all explicit exports and skipped
when the name is already taken, so explicit names keep their targets
and duplicate members can no longer be emitted. Union-body operations
also get each variant's full params, nested under the export's
namespace only, so they never claim a flat alias.
- The group-level and nested aliases share one intermediate declaration,
and the export's namespace merges into an existing child of the same
name instead of being renamed.
For SSE operations without a request body, resources.ts no longer emits
the duplicate X$2 intermediates (exported types are unchanged), and an
explicit export that collides with a generated <Alias>Streaming or
<Alias>NonStreaming name now keeps the flat name instead of the params
type.
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.
Why
In
methodSignature: params-objectmode, an operation-levelx-speakeasy-exportsentry on an SSE-overloaded operation whose request body is a union of objects only exported the base<Op>Paramstype. The types the method actually accepts (i.e. union-level<Op>Params{NonStreaming,Streaming}and each variant's<Member>Params{,NonStreaming,Streaming}, which include non-body parameters) were not reachable fromresources.ts.The method also declared no overload for the union-level Streaming/NonStreaming params, so passing a value of that type resolved to the catch-all overload and lost the narrowed stream return type.