@@ -232,6 +232,10 @@ const createRequestParamsSchema = ({
232232 } ,
233233 } ;
234234
235+ const fixedSchema = config . hooks . onCreateRequestParams ( schema ) ;
236+
237+ if ( fixedSchema ) return fixedSchema ;
238+
235239 if ( extractRequestParams ) {
236240 return createComponent ( "schemas" , classNameCase ( `${ routeName . usage } Params` ) , { ...schema } ) ;
237241 }
@@ -264,12 +268,17 @@ const parseRoutes = ({ usageSchema, parsedSchemas, moduleNameIndex, extractReque
264268 tags,
265269 responses,
266270 requestBodyName,
271+ produces,
272+ ...otherInfo
267273 } = requestInfo ;
268274 const routeId = nanoid ( 12 ) ;
269275 const hasSecurity = ! ! (
270276 ( globalSecurity && globalSecurity . length ) ||
271277 ( security && security . length )
272278 ) ;
279+ const responseContentTypes =
280+ produces ||
281+ _ . flatten ( _ . map ( responses , ( response ) => response && _ . keys ( response . content ) ) ) ;
273282
274283 const formDataParams = getRouteParams ( parameters , "formData" ) ;
275284 const pathParams = getRouteParams ( parameters , "path" ) ;
@@ -419,7 +428,7 @@ const parseRoutes = ({ usageSchema, parsedSchemas, moduleNameIndex, extractReque
419428 hasSecurity && ` * @secure` ,
420429 ...( config . generateResponses && responsesTypes . length
421430 ? responsesTypes . map (
422- ( { type, status, description, isSuccess } ) =>
431+ ( { type, status, description } ) =>
423432 ` * @response \`${ status } \` \`${ type } \` ${ description } ` ,
424433 )
425434 : [ ] ) ,
@@ -428,6 +437,7 @@ const parseRoutes = ({ usageSchema, parsedSchemas, moduleNameIndex, extractReque
428437 const path = route . replace ( / { / g, "${" ) ;
429438
430439 const response = {
440+ contentTypes : responseContentTypes ,
431441 type : getReturnType ( responses , parsedSchemas , operationId ) ,
432442 errorType : getErrorReturnType ( responses , parsedSchemas , operationId ) ,
433443 } ;
@@ -459,6 +469,10 @@ const parseRoutes = ({ usageSchema, parsedSchemas, moduleNameIndex, extractReque
459469 description,
460470 tags,
461471 summary,
472+ responses,
473+ produces,
474+ requestBody,
475+ ...otherInfo ,
462476 } ,
463477 } ;
464478
0 commit comments