diff --git a/packages/bruno-cli/src/runner/interpolate-vars.js b/packages/bruno-cli/src/runner/interpolate-vars.js index 886974c0f7..b53bc10ba9 100644 --- a/packages/bruno-cli/src/runner/interpolate-vars.js +++ b/packages/bruno-cli/src/runner/interpolate-vars.js @@ -82,11 +82,11 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces request.data = _interpolate(request.data); } - each(request.params, (param) => { + each(request.pathParams, (param) => { param.value = _interpolate(param.value); }); - if (request?.params?.length) { + if (request?.pathParams?.length) { let url = request.url; if (!url.startsWith('http://') && !url.startsWith('https://')) { @@ -107,7 +107,7 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces return '/' + path; } else { const name = path.slice(1); - const existingPathParam = request.params.find((param) => param.type === 'path' && param.name === name); + const existingPathParam = request.pathParams.find((param) => param.type === 'path' && param.name === name); return existingPathParam ? '/' + existingPathParam.value : ''; } }) diff --git a/packages/bruno-cli/src/runner/prepare-request.js b/packages/bruno-cli/src/runner/prepare-request.js index aaeb154416..e30f8337f3 100644 --- a/packages/bruno-cli/src/runner/prepare-request.js +++ b/packages/bruno-cli/src/runner/prepare-request.js @@ -29,7 +29,8 @@ const prepareRequest = (request, collectionRoot) => { let axiosRequest = { method: request.method, url: request.url, - headers: headers + headers: headers, + pathParams: request?.params?.filter((param) => param.type === 'path') }; const collectionAuth = get(collectionRoot, 'request.auth');