@@ -65,11 +65,11 @@ export class SchemaRoutes {
6565 ] ) ;
6666 }
6767
68- createRequestsMap = ( routeInfoByMethodsMap ) => {
69- const parameters = lodash . get ( routeInfoByMethodsMap , "parameters" ) ;
68+ createRequestsMap = ( routesByMethod ) => {
69+ const parameters = lodash . get ( routesByMethod , "parameters" ) ;
7070
7171 return lodash . reduce (
72- routeInfoByMethodsMap ,
72+ routesByMethod ,
7373 ( acc , requestInfo , method ) => {
7474 if (
7575 method . startsWith ( "x-" ) ||
@@ -91,10 +91,9 @@ export class SchemaRoutes {
9191 ) ;
9292 } ;
9393
94- parseRouteName = ( originalRouteName ) => {
94+ parseRouteName = ( rawRoute ) => {
9595 const routeName =
96- this . config . hooks . onPreBuildRoutePath ( originalRouteName ) ||
97- originalRouteName ;
96+ this . config . hooks . onPreBuildRoutePath ( rawRoute ) || rawRoute ;
9897
9998 // TODO forbid leading symbols [\]^` in a major release (allowed yet for backwards compatibility)
10099 const pathParamMatches = ( routeName || "" ) . match (
@@ -157,15 +156,16 @@ export class SchemaRoutes {
157156 ) ;
158157
159158 for ( const paramName of paramNames ) {
160- // @ts -expect-error TS(2339) FIXME: Property 'includes' does not exist on type 'unknow... Remove this comment to see the full error message
161- if ( paramName . includes ( "-" ) ) {
159+ if ( typeof paramName === "string" && paramName . includes ( "-" ) ) {
162160 consola . warn ( "wrong query param name" , paramName ) ;
163161 }
164162
165163 queryParams . push ( {
166164 $match : paramName ,
167- // @ts -expect-error TS(2345) FIXME: Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message
168- name : lodash . camelCase ( paramName ) ,
165+ name :
166+ typeof paramName === "string"
167+ ? lodash . camelCase ( paramName )
168+ : lodash . camelCase ( String ( paramName ) ) ,
169169 required : true ,
170170 type : "string" ,
171171 description : "" ,
@@ -178,7 +178,7 @@ export class SchemaRoutes {
178178 }
179179
180180 const result = {
181- originalRoute : originalRouteName || "" ,
181+ originalRoute : rawRoute || "" ,
182182 route : fixedRoute ,
183183 pathParams,
184184 queryParams,
@@ -241,9 +241,7 @@ export class SchemaRoutes {
241241 routeParam . name = lodash . camelCase ( routeParam . name ) ;
242242 }
243243
244- if ( routeParam ) {
245- routeParams [ routeParam . in ] . push ( routeParam ) ;
246- }
244+ routeParams [ routeParam . in ] . push ( routeParam ) ;
247245 } ) ;
248246
249247 // used in case when path parameters is not declared in requestInfo.parameters ("in": "path")
@@ -418,8 +416,7 @@ export class SchemaRoutes {
418416 lodash . reduce (
419417 requestInfos ,
420418 ( acc , requestInfo , status ) => {
421- // @ts -expect-error TS(2554) FIXME: Expected 2 arguments, but got 1.
422- const contentTypes = this . getContentTypes ( [ requestInfo ] ) ;
419+ const contentTypes = this . getContentTypes ( [ requestInfo ] , operationId ) ;
423420
424421 return [
425422 ...acc ,
0 commit comments