Skip to content

Commit 4becfbf

Browse files
update: fix key naming for variation_id in CMAB response handling
1 parent 758f44b commit 4becfbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/optimizely/cmab/cmab_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def _do_fetch(url, request_body, timeout)
122122
raise CmabInvalidResponseError, error_message
123123
end
124124

125-
body['predictions'][0]['variationId']
125+
body['predictions'][0]['variation_id']
126126
end
127127

128128
def validate_response(body)
@@ -137,7 +137,7 @@ def validate_response(body)
137137
body['predictions'].is_a?(Array) &&
138138
!body['predictions'].empty? &&
139139
body['predictions'][0].is_a?(Hash) &&
140-
body['predictions'][0].key?('variationId')
140+
body['predictions'][0].key?('variation_id')
141141
end
142142

143143
def _do_fetch_with_retry(url, request_body, retry_config, timeout)

0 commit comments

Comments
 (0)