We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed4b3f3 commit da22f83Copy full SHA for da22f83
packages/gitbook/src/lib/openapi/fetch.ts
@@ -63,11 +63,12 @@ export function resolveOpenAPIBlock<T extends OpenAPIBlockType = 'operation'>(
63
args: ResolveOpenAPIBlockArgs<T>
64
): Promise<OpenAPIBlockResult<T>> {
65
if (weakmap.has(args.block)) {
66
- return weakmap.get(args.block);
+ // We enforce the type here cause weakmap doesn't know the type of the value
67
+ return weakmap.get<AnyOpenAPIOperationBlock, Promise<OpenAPIBlockResult<T>>>(args.block);
68
}
69
70
const result = baseResolveOpenAPIBlock(args);
- weakmap.set(args.block, result as Promise<OpenAPIBlockResult>);
71
+ weakmap.set(args.block, result);
72
return result;
73
74
0 commit comments