fix api reports
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com> Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
committed by
aramissennyeydd
parent
92051737af
commit
4ab164dd86
@@ -19,11 +19,9 @@ import { PathTemplate, ValueOf } from './common';
|
||||
|
||||
export type EndpointMap = Record<
|
||||
string,
|
||||
{ query?: object; body?: object; response: object | void; path?: object }
|
||||
{ query?: object; body?: object; response?: object; path?: object }
|
||||
>;
|
||||
|
||||
type UnknownIfVoid<T> = T extends void ? unknown : T;
|
||||
|
||||
// OpenAPI generator doesn't emit regular lowercase 'delete'.
|
||||
type HttpMethods = 'all' | 'put' | 'get' | 'post' | '_delete';
|
||||
|
||||
@@ -51,7 +49,7 @@ type ResponseBody<
|
||||
Method extends DocEndpointMethod<Doc, Endpoint>,
|
||||
> = `#${Method}|${Endpoint}` extends keyof Doc
|
||||
? 'response' extends keyof Doc[`#${Method}|${Endpoint}`]
|
||||
? UnknownIfVoid<Doc[`#${Method}|${Endpoint}`]['response']>
|
||||
? Doc[`#${Method}|${Endpoint}`]['response']
|
||||
: unknown
|
||||
: unknown;
|
||||
type QuerySchema<
|
||||
|
||||
Reference in New Issue
Block a user