Skip to content

Commit c9c11ae

Browse files
bilby91claude
andcommitted
fix: forward TResponse generic through SDK Options type for SSE endpoints
The onSseEvent callback was typed as StreamEvent<unknown> because the response type was never threaded through the generated Options type on the non-Nuxt path. This adds a TResponse generic to the SDK Options type alias and forwards it to the client Options, then passes the unwrapped response type for SSE endpoints so event.data is correctly typed. Closes #3463 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0d2b8ec commit c9c11ae

498 files changed

Lines changed: 561 additions & 509 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/openapi-ts-angular-common/src/client/client/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ type SseFn = <
156156
ThrowOnError extends boolean = false,
157157
TResponseStyle extends ResponseStyle = 'fields',
158158
>(
159-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
159+
options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>,
160160
) => Promise<ServerSentEventsResult<TData, TError>>;
161161

162162
type RequestFn = <

examples/openapi-ts-angular-common/src/client/sdk.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ import type {
6565
export type Options<
6666
TData extends TDataShape = TDataShape,
6767
ThrowOnError extends boolean = boolean,
68-
> = Options2<TData, ThrowOnError> & {
68+
TResponse = unknown,
69+
> = Options2<TData, ThrowOnError, TResponse> & {
6970
/**
7071
* You can provide a client instance returned by `createClient()` instead of
7172
* individual options. This might be also useful if you want to implement a

examples/openapi-ts-angular/src/client/client/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ type SseFn = <
156156
ThrowOnError extends boolean = false,
157157
TResponseStyle extends ResponseStyle = 'fields',
158158
>(
159-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
159+
options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>,
160160
) => Promise<ServerSentEventsResult<TData, TError>>;
161161

162162
type RequestFn = <

examples/openapi-ts-angular/src/client/sdk.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ import type {
6767
export type Options<
6868
TData extends TDataShape = TDataShape,
6969
ThrowOnError extends boolean = boolean,
70-
> = Options2<TData, ThrowOnError> & {
70+
TResponse = unknown,
71+
> = Options2<TData, ThrowOnError, TResponse> & {
7172
/**
7273
* You can provide a client instance returned by `createClient()` instead of
7374
* individual options. This might be also useful if you want to implement a

examples/openapi-ts-axios/src/client/client/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean
105105
) => RequestResult<TData, TError, ThrowOnError>;
106106

107107
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(
108-
options: Omit<RequestOptions<TData, ThrowOnError>, 'method'>,
108+
options: Omit<RequestOptions<never, ThrowOnError>, 'method'>,
109109
) => Promise<ServerSentEventsResult<TData, TError>>;
110110

111111
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(

examples/openapi-ts-axios/src/client/sdk.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ import type {
6565
export type Options<
6666
TData extends TDataShape = TDataShape,
6767
ThrowOnError extends boolean = boolean,
68-
> = Options2<TData, ThrowOnError> & {
68+
TResponse = unknown,
69+
> = Options2<TData, ThrowOnError, TResponse> & {
6970
/**
7071
* You can provide a client instance returned by `createClient()` instead of
7172
* individual options. This might be also useful if you want to implement a

examples/openapi-ts-fastify/src/client/client/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ type SseFn = <
149149
ThrowOnError extends boolean = false,
150150
TResponseStyle extends ResponseStyle = 'fields',
151151
>(
152-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
152+
options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>,
153153
) => Promise<ServerSentEventsResult<TData, TError>>;
154154

155155
type RequestFn = <

examples/openapi-ts-fastify/src/client/sdk.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import type {
1717
export type Options<
1818
TData extends TDataShape = TDataShape,
1919
ThrowOnError extends boolean = boolean,
20-
> = Options2<TData, ThrowOnError> & {
20+
TResponse = unknown,
21+
> = Options2<TData, ThrowOnError, TResponse> & {
2122
/**
2223
* You can provide a client instance returned by `createClient()` instead of
2324
* individual options. This might be also useful if you want to implement a

examples/openapi-ts-fetch/src/client/client/types.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ type SseFn = <
149149
ThrowOnError extends boolean = false,
150150
TResponseStyle extends ResponseStyle = 'fields',
151151
>(
152-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
152+
options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>,
153153
) => Promise<ServerSentEventsResult<TData, TError>>;
154154

155155
type RequestFn = <

examples/openapi-ts-fetch/src/client/sdk.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ import type {
6565
export type Options<
6666
TData extends TDataShape = TDataShape,
6767
ThrowOnError extends boolean = boolean,
68-
> = Options2<TData, ThrowOnError> & {
68+
TResponse = unknown,
69+
> = Options2<TData, ThrowOnError, TResponse> & {
6970
/**
7071
* You can provide a client instance returned by `createClient()` instead of
7172
* individual options. This might be also useful if you want to implement a

0 commit comments

Comments
 (0)