File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 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 {
268268 //
269269 // This method will iterate through all variables, check their definition type from the spec
270270 // 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 } {
272272 const parsedVariables: { [key: string]: any } = {};
273273
274274 Object.entries(variables).forEach(
275275 ([variableName, value]) => {
276276 const variableDefinition = this.operationVariables[variableName];
277+ const typecastValue = typecastVariable(value, variableDefinition);
277278
278- parsedVariables[variableName] = typecastVariable(value, variableDefinition) ;
279+ parsedVariables[variableName] = encoder ? encode(typecastValue) : typecastValue ;
279280 }
280281 );
281282
@@ -287,7 +288,7 @@ export default class Route implements IMountableItem {
287288 const { query, params, body } = req;
288289
289290 const parsedQueryVariables = this.typecastVariables(query);
290- const parsedPathVariables = this.typecastVariables(params);
291+ const parsedPathVariables = this.typecastVariables(params, encodeURI );
291292
292293 const providedVariables = { ...parsedQueryVariables, ...parsedPathVariables, ...body };
293294
You can’t perform that action at this time.
0 commit comments