Skip to content

Commit cd65ac0

Browse files
committed
fix additional params evaluation to include string array params
1 parent 278c1ae commit cd65ac0

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

src/aws-cpp-sdk-core/include/smithy/client/AwsSmithyClient.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,15 @@ namespace client
169169
const auto& epParams = ctx.m_pRequest->GetEndpointContextParams();
170170
for (const auto& epParam : epParams) {
171171
using ParameterType = Aws::Endpoint::EndpointParameter::ParameterType;
172-
if(epParam.GetStoredType() == ParameterType::STRING)
173-
identityParams.additionalProperties.insert({epParam.GetName(), epParam.GetStrValueNoCheck()});
174-
else if (epParam.GetStoredType() == ParameterType::BOOLEAN)
175-
identityParams.additionalProperties.insert({epParam.GetName(), epParam.GetBoolValueNoCheck()});
176-
else
177-
assert(!"Unknown endpoint parameter!");
172+
if(epParam.GetStoredType() == ParameterType::STRING) {
173+
identityParams.additionalProperties.insert({epParam.GetName(), epParam.GetStrValueNoCheck()});
174+
} else if (epParam.GetStoredType() == ParameterType::BOOLEAN) {
175+
identityParams.additionalProperties.insert({epParam.GetName(), epParam.GetBoolValueNoCheck()});
176+
} else if (epParam.GetStoredType() == ParameterType::STRING_ARRAY) {
177+
identityParams.additionalProperties.insert({epParam.GetName(), epParam.GetStrArrayValueNoCheck()});
178+
} else {
179+
assert(!"Unknown endpoint parameter!");
180+
}
178181
}
179182
const auto& serviceParams = ctx.m_pRequest->GetServiceSpecificParameters();
180183
if (serviceParams) {

src/aws-cpp-sdk-core/include/smithy/identity/auth/AuthSchemeResolverBase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class DefaultAuthSchemeResolverParameters
2626
Aws::UnorderedMap<Aws::String, Aws::Crt::Variant<Aws::String,
2727
bool,
2828
Aws::Client::AWSAuthV4Signer::PayloadSigningPolicy,
29-
Aws::Auth::AWSSigningAlgorithm > > additionalProperties;
29+
Aws::Auth::AWSSigningAlgorithm,
30+
Aws::Vector<Aws::String>>> additionalProperties;
3031

3132
};
3233

tests/aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <aws/dynamodb/model/ScanRequest.h>
3232
#include <aws/dynamodb/model/UpdateItemRequest.h>
3333
#include <aws/dynamodb/model/DeleteItemRequest.h>
34+
#include <aws/dynamodb/model/BatchGetItemRequest.h>
3435
#include <aws/testing/TestingEnvironment.h>
3536
#include <aws/core/utils/UUID.h>
3637

@@ -1523,5 +1524,23 @@ TEST_F(TableOperationTest, TestEndpointOverride)
15231524
}
15241525
}
15251526

1527+
TEST_F(TableOperationTest, TestBatchGetItem) {
1528+
Aws::String table_name = BuildTableName(BASE_SIMPLE_TABLE);
1529+
CreateTable(table_name, 10, 10);
1530+
1531+
AttributeValue value{"wheres everyone going, bingo?"};
1532+
const auto put_item_result = m_client->PutItem(PutItemRequest().WithTableName(table_name).WithItem({{HASH_KEY_NAME, value}}));
1533+
AWS_ASSERT_SUCCESS(put_item_result);
1534+
1535+
const auto batch_get_item_result = m_client->BatchGetItem(BatchGetItemRequest()
1536+
.WithRequestItems({
1537+
{
1538+
table_name, KeysAndAttributes().WithKeys({{{HASH_KEY_NAME, value}}})
1539+
}
1540+
}));
1541+
AWS_ASSERT_SUCCESS(batch_get_item_result);
1542+
EXPECT_EQ(1ul, batch_get_item_result.GetResult().GetResponses().size());
1543+
}
1544+
15261545
} // anonymous namespace
15271546

0 commit comments

Comments
 (0)