Skip to content

Commit a969c13

Browse files
committed
cleanup GetResponseContent
1 parent c11622d commit a969c13

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

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

+9-11
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,15 @@ type GetResponseContent<
142142
T extends Record<string | number, any>,
143143
Media extends MediaType = MediaType,
144144
ResponseCode extends keyof T = keyof T,
145-
> = OpenApiStatusToHttpStatus<ResponseCode, keyof T> extends number
146-
? {
147-
[K in ResponseCode]: T[K]["content"] extends Record<string, any>
148-
? FilterKeys<T[K]["content"], Media> extends never
149-
? T[K]["content"]
150-
: FilterKeys<T[K]["content"], Media>
151-
: K extends keyof T
152-
? T[K]["content"]
153-
: never;
154-
}[ResponseCode]
155-
: never;
145+
> = {
146+
[K in ResponseCode]: T[K]["content"] extends Record<string, any>
147+
? FilterKeys<T[K]["content"], Media> extends never
148+
? T[K]["content"]
149+
: FilterKeys<T[K]["content"], Media>
150+
: K extends keyof T
151+
? T[K]["content"]
152+
: never;
153+
}[ResponseCode];
156154

157155
/**
158156
* Return all 5XX and 4XX responses (in that order) from a Response Object Map

0 commit comments

Comments
 (0)