Skip to content

Commit 32c0ce3

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 c3e497c commit 32c0ce3

399 files changed

Lines changed: 462 additions & 410 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/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/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/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

examples/openapi-ts-ky/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-nestjs/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-nestjs/src/client/sdk.gen.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import type {
2424
export type Options<
2525
TData extends TDataShape = TDataShape,
2626
ThrowOnError extends boolean = boolean,
27-
> = Options2<TData, ThrowOnError> & {
27+
TResponse = unknown,
28+
> = Options2<TData, ThrowOnError, TResponse> & {
2829
/**
2930
* You can provide a client instance returned by `createClient()` instead of
3031
* individual options. This might be also useful if you want to implement a

0 commit comments

Comments
 (0)