Skip to content

Commit 2f73fef

Browse files
authored
Fix SimpleDB serialization with latest aws-sdk-core (#3056)
1 parent 1db6f09 commit 2f73fef

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

build_tools/customizations.rb

+20-4
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ def dynamodb_example_deep_transform(subsegment, keys)
199199
api('S3Control') do |api|
200200
# handled by endpoints 2.0
201201
api['operations'].each do |_key, operation|
202-
# removes accountId host prefix trait and requiredness
203-
# defensive - checks host prefix labels and removes only those from API
202+
# Removes the accountId host prefix trait and requiredness.
203+
# Checks the hostPrefix labels and removes only those from the API.
204204
next unless operation['endpoint'] &&
205-
(host_prefix = operation['endpoint']['hostPrefix'])
206-
host_prefix != '{AccountId}.'
205+
(host_prefix = operation['endpoint']['hostPrefix']) &&
206+
host_prefix == '{AccountId}.'
207207

208208
operation['endpoint'].delete('hostPrefix')
209209

@@ -216,6 +216,22 @@ def dynamodb_example_deep_transform(subsegment, keys)
216216
end
217217
end
218218

219+
# SimpleDB does not adhere to the query protocol guidelines because it
220+
# uses both flattened and locationName. Query protocol is supposed to
221+
# ignore location name (xmlName) when flattened (xmlFlattened) is used.
222+
api('SimpleDB') do |api|
223+
api['shapes'].each do |_, shape|
224+
next unless shape['type'] == 'structure'
225+
226+
shape['members'].each do |_, member|
227+
member_ref = api['shapes'][member['shape']]
228+
next unless member_ref['flattened']
229+
230+
member['locationName'] = member_ref['member']['locationName']
231+
end
232+
end
233+
end
234+
219235
smoke('SMS') do |smoke|
220236
smoke['testCases'] = []
221237
end

gems/aws-sdk-simpledb/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Unreleased Changes
22
------------------
33

4+
* Issue - Fix query serialization with `aws-sdk-core` >= 3.192.
5+
46
1.49.0 (2024-06-25)
57
------------------
68

0 commit comments

Comments
 (0)