Bugfix: Path replacement regex not working (#6580)

A previous change to make the regex a variable to allow proper linting
resulted in the regexp not having access to the value associated with
the variable and the path variable not being replaced.

Moves the regexp variable inside the for loop to allow the value to be
used and the path variable to be replaced with the provided value.
This commit is contained in:
Kenny Jones 2017-09-28 02:14:47 -04:00 committed by wing328
parent d04b7642f6
commit 87a9caa33f
2 changed files with 2 additions and 2 deletions

View File

@ -407,8 +407,8 @@ build_request_path() {
fi
# First replace all path parameters in the path
local path_regex="(.*)(\\{$pparam\\})(.*)"
for pparam in "${path_params[@]}"; do
local path_regex="(.*)(\\{$pparam\\})(.*)"
if [[ $path_template =~ $path_regex ]]; then
path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]}
fi

View File

@ -509,8 +509,8 @@ build_request_path() {
fi
# First replace all path parameters in the path
local path_regex="(.*)(\\{$pparam\\})(.*)"
for pparam in "${path_params[@]}"; do
local path_regex="(.*)(\\{$pparam\\})(.*)"
if [[ $path_template =~ $path_regex ]]; then
path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]}
fi