Skip to content

Commit b2facfb

Browse files
committed
test3
1 parent cf7633f commit b2facfb

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

features/step_definitions/request.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,25 @@ def build_given(api_version, operation)
238238
result
239239
end if operation["parameters"]
240240

241+
# Store path parameters for undo operations
242+
# Path parameters are required positional parameters that are not the body
243+
if operation["parameters"] && args
244+
required_params = method.parameters.select { |p| p[0] == :req }
245+
246+
operation["parameters"].each_with_index do |p, index|
247+
# Only store if:
248+
# 1. Index is within required params range
249+
# 2. Parameter is not named "body" (body is required but not a path param)
250+
if index < required_params.length && p["name"] != "body"
251+
param_value = args[index]
252+
# Store with all naming variants for compatibility with undo lookup
253+
path_parameters[p["name"]] = param_value
254+
path_parameters[p["name"].to_parameter] = param_value
255+
path_parameters[p["name"].to_parameter.to_sym] = param_value
256+
end
257+
end
258+
end
259+
241260
result = method.call(*args)[0]
242261

243262
# register undo method

0 commit comments

Comments
 (0)