Skip to content

Commit e63a345

Browse files
authored
Fix missing type bug (#1326)
1 parent 5948c0b commit e63a345

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.changeset/early-feet-report.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-typescript-helpers": patch
3+
---
4+
5+
Fix type bug

packages/openapi-typescript-helpers/index.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ export type ErrorStatus = 500 | '5XX' | 400 | 401 | 402 | 403 | 404 | 405 | 406
1515
export type PathsWithMethod<Paths extends Record<string, PathItemObject>, PathnameMethod extends HttpMethod> = {
1616
[Pathname in keyof Paths]: Paths[Pathname] extends { [K in PathnameMethod]: any } ? Pathname : never;
1717
}[keyof Paths];
18+
/** DO NOT USE! Only used only for OperationObject type inference */
19+
export interface OperationObject {
20+
parameters: any;
21+
params?: { query?: Record<string, unknown> };
22+
requestBody: any; // note: "any" will get overridden in inference
23+
responses: any;
24+
}
1825
/** Internal helper used in PathsWithMethod */
1926
export type PathItemObject = { [M in HttpMethod]: OperationObject } & { parameters?: any };
2027
/** Return `responses` for an Operation Object */
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"rootDir": "."
4+
"rootDir": ".",
5+
"skipLibCheck": false
56
},
67
"include": ["."]
78
}

0 commit comments

Comments
 (0)