File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments