Skip to content

Commit 1671f6f

Browse files
authored
feat(openapi-fetch): enable middleware request param module augmentation
1 parent 12f9c29 commit 1671f6f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/openapi-fetch/src/index.d.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,20 @@ export type MergedOptions<T = unknown> = {
131131
fetch: typeof globalThis.fetch;
132132
};
133133

134+
export interface MiddlewareRequestParams {
135+
query?: Record<string, unknown>;
136+
header?: Record<string, unknown>;
137+
path?: Record<string, unknown>;
138+
cookie?: Record<string, unknown>;
139+
}
140+
134141
export interface MiddlewareCallbackParams {
135142
/** Current Request object */
136143
request: Request;
137144
/** The original OpenAPI schema path (including curly braces) */
138145
readonly schemaPath: string;
139146
/** OpenAPI parameters as provided from openapi-fetch */
140-
readonly params: {
141-
query?: Record<string, unknown>;
142-
header?: Record<string, unknown>;
143-
path?: Record<string, unknown>;
144-
cookie?: Record<string, unknown>;
145-
};
147+
readonly params: MiddlewareRequestParams;
146148
/** Unique ID for this request */
147149
readonly id: string;
148150
/** createClient options (read-only) */

0 commit comments

Comments
 (0)