File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -268,14 +268,15 @@ export default class Route implements IMountableItem {
268
268
//
269
269
// This method will iterate through all variables, check their definition type from the spec
270
270
// and typecast them
271
- private typecastVariables ( variables : { [ key : string ] : string } ) : { [ key : string ] : any } {
271
+ private typecastVariables ( variables : { [ key : string ] : string } , encoder ?: Function ) : { [ key : string ] : any } {
272
272
const parsedVariables : { [ key : string ] : any } = { } ;
273
273
274
274
Object . entries ( variables ) . forEach (
275
275
( [ variableName , value ] ) => {
276
276
const variableDefinition = this . operationVariables [ variableName ] ;
277
+ const typecastValue = typecastVariable ( value , variableDefinition ) ;
277
278
278
- parsedVariables [ variableName ] = typecastVariable ( value , variableDefinition ) ;
279
+ parsedVariables [ variableName ] = encoder ? encode ( typecastValue ) : typecastValue ;
279
280
}
280
281
) ;
281
282
@@ -287,7 +288,7 @@ export default class Route implements IMountableItem {
287
288
const { query, params, body } = req ;
288
289
289
290
const parsedQueryVariables = this . typecastVariables ( query ) ;
290
- const parsedPathVariables = this . typecastVariables ( params ) ;
291
+ const parsedPathVariables = this . typecastVariables ( params , encodeURI ) ;
291
292
292
293
const providedVariables = { ...parsedQueryVariables , ...parsedPathVariables , ...body } ;
293
294
You can’t perform that action at this time.
0 commit comments