Skip to content

Commit c2aeee5

Browse files
committed
[CI] Test Runner: Update parsing keys to consider '.' format
1 parent c60b90b commit c2aeee5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

api-spec-testing/test_file/task_group.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ def variables_to_transform_and_set
296296
def transform_and_set_variable(action)
297297
variables_to_transform_and_set.each do |set_definition|
298298
set_definition['transform_and_set'].each do |response_key, transform_description|
299-
300299
match_base_64_transform = /(\#base64EncodeCredentials\()(\S*)\)/
301300
matches = match_base_64_transform.match(transform_description)
302301
fields = matches[2].split(',') if matches.length > 0

api-spec-testing/test_file/test.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,15 @@ def find_value_in_document(chain, document)
5858
#
5959
# @since 6.2.0
6060
def split_and_parse_key(key)
61-
key.split(/(?<!\\)\./).map do |key|
62-
(key =~ /\A[-+]?[0-9]+\z/) ? key.to_i: key.gsub('\\', '')
61+
key.split(/(?<!\\)\./).reject { |k| k.empty? }.map do |key_part|
62+
case key_part
63+
when /^\.\$/ # For keys in the form of .$key
64+
key_part.gsub(/^\./, '')
65+
when /\A[-+]?[0-9]+\z/
66+
key_part.to_i
67+
else
68+
key_part.gsub('\\', '')
69+
end
6370
end.reject { |k| k == '$body' }
6471
end
6572
end

0 commit comments

Comments
 (0)