Skip to content

Commit d23e8bb

Browse files
chore: removed the async logic
1 parent 59f2c27 commit d23e8bb

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/handler.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ async function generatePaths<
130130
>(hono: Hono<E, S, P>, ctx: SpecContext): Promise<OpenAPIV3_1.PathsObject> {
131131
const paths: OpenAPIV3_1.PathsObject = {};
132132

133-
const promises: Promise<void>[] = [];
134133
for (const route of hono.routes) {
135134
const middlewareHandler = route.handler[uniqueSymbol] as
136135
| HandlerUniqueProperty
@@ -167,22 +166,16 @@ async function generatePaths<
167166
const defaultOptionsForThisMethod =
168167
ctx.options.defaultOptions?.[routeMethod];
169168

170-
promises.push(
171-
getSpec(middlewareHandler, defaultOptionsForThisMethod).then(
172-
({ schema: routeSpecs, components = {} }) => {
173-
ctx.components = mergeComponentsObjects(ctx.components, components);
169+
const { schema: routeSpecs, components = {} } = await getSpec(middlewareHandler, defaultOptionsForThisMethod)
174170

175-
registerSchemaPath({
176-
route,
177-
specs: routeSpecs,
178-
paths,
179-
});
180-
},
181-
),
182-
);
183-
}
171+
ctx.components = mergeComponentsObjects(ctx.components, components);
184172

185-
await Promise.all(promises);
173+
registerSchemaPath({
174+
route,
175+
specs: routeSpecs,
176+
paths,
177+
});
178+
}
186179

187180
return paths;
188181
}

0 commit comments

Comments
 (0)