Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ void EC2ProtocolClient::init(const EC2Protocol::EC2ProtocolClientConfiguration&

void EC2ProtocolClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops my bad, i did re-gen protocol tests after this

m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ void JsonProtocolClient::init(const JsonProtocol::JsonProtocolClientConfiguratio

void JsonProtocolClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void JSONRPC10Client::init(const JSONRPC10::JSONRPC10ClientConfiguration& config

void JSONRPC10Client::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ void ProtocolMockClient::init(const ProtocolMock::ProtocolMockClientConfiguratio

void ProtocolMockClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void QueryCompatibleJSONRPC10Client::init(const QueryCompatibleJSONRPC10::QueryC

void QueryCompatibleJSONRPC10Client::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ void QueryProtocolClient::init(const QueryProtocol::QueryProtocolClientConfigura

void QueryProtocolClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ void RestJsonProtocolClient::init(const RestJsonProtocol::RestJsonProtocolClient

void RestJsonProtocolClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ void RestXmlProtocolClient::init(const RestXmlProtocol::RestXmlProtocolClientCon

void RestXmlProtocolClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void RpcV2ProtocolClient::init(const RpcV2Protocol::RpcV2ProtocolClientConfigura

void RpcV2ProtocolClient::OverrideEndpoint(const Aws::String& endpoint) {
AWS_CHECK_PTR(SERVICE_NAME, m_endpointProvider);
m_clientConfiguration.endpointOverride = endpoint;
m_endpointProvider->OverrideEndpoint(endpoint);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Aws::String EmptyInputOutputRequest::SerializePayload() const {

Aws::Http::HeaderValueCollection EmptyInputOutputRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::CBOR_CONTENT_TYPE);
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
Aws::StringStream ss;
if (m_requestIdHasBeenSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Aws::String Float16Request::SerializePayload() const { return {}; }

Aws::Http::HeaderValueCollection Float16Request::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
return headers;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Aws::String FractionalSecondsRequest::SerializePayload() const { return {}; }

Aws::Http::HeaderValueCollection FractionalSecondsRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
return headers;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Aws::String GreetingWithErrorsRequest::SerializePayload() const { return {}; }

Aws::Http::HeaderValueCollection GreetingWithErrorsRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
return headers;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Aws::String NoInputOutputRequest::SerializePayload() const { return {}; }

Aws::Http::HeaderValueCollection NoInputOutputRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
return headers;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Aws::String OptionalInputOutputRequest::SerializePayload() const {

Aws::Http::HeaderValueCollection OptionalInputOutputRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::CBOR_CONTENT_TYPE);
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
Aws::StringStream ss;
if (m_requestIdHasBeenSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Aws::String RecursiveShapesRequest::SerializePayload() const {

Aws::Http::HeaderValueCollection RecursiveShapesRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::CBOR_CONTENT_TYPE);
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
Aws::StringStream ss;
if (m_requestIdHasBeenSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ Aws::String RpcV2CborDenseMapsRequest::SerializePayload() const {

Aws::Http::HeaderValueCollection RpcV2CborDenseMapsRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::CBOR_CONTENT_TYPE);
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
Aws::StringStream ss;
if (m_requestIdHasBeenSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Aws::String RpcV2CborListsRequest::SerializePayload() const {
encoder.WriteArrayStart(m_timestampList.size());
for (const auto& item_0 : m_timestampList) {
encoder.WriteTag(1); // 1 represents Epoch-based date/time. See https://www.rfc-editor.org/rfc/rfc8949.html#tags
encoder.WriteUInt(item_0.Millis());
encoder.WriteUInt(item_0.Seconds());
}
}

Expand Down Expand Up @@ -142,8 +142,8 @@ Aws::String RpcV2CborListsRequest::SerializePayload() const {

Aws::Http::HeaderValueCollection RpcV2CborListsRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::CBOR_CONTENT_TYPE);
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
Aws::StringStream ss;
if (m_requestIdHasBeenSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ RpcV2CborListsResult& RpcV2CborListsResult::operator=(const Aws::AmazonWebServic
ss_1 << Aws::String(reinterpret_cast<const char*>(val.value().ptr), val.value().len);
}
}
m_blobList.push_back(ss_1.str());
m_blobList.push_back(Aws::Utils::ByteBuffer(ss_1.str()));
ss_1.clear();
}
}
Expand Down Expand Up @@ -732,7 +732,7 @@ RpcV2CborListsResult& RpcV2CborListsResult::operator=(const Aws::AmazonWebServic
ss_1 << Aws::String(reinterpret_cast<const char*>(val.value().ptr), val.value().len);
}
}
m_blobList.push_back(ss_1.str());
m_blobList.push_back(Aws::Utils::ByteBuffer(ss_1.str()));
ss_1.clear();
}
}
Expand Down Expand Up @@ -1453,7 +1453,7 @@ RpcV2CborListsResult& RpcV2CborListsResult::operator=(const Aws::AmazonWebServic
ss_1 << Aws::String(reinterpret_cast<const char*>(val.value().ptr), val.value().len);
}
}
m_blobList.push_back(ss_1.str());
m_blobList.push_back(Aws::Utils::ByteBuffer(ss_1.str()));
ss_1.clear();
}
}
Expand Down Expand Up @@ -1493,7 +1493,7 @@ RpcV2CborListsResult& RpcV2CborListsResult::operator=(const Aws::AmazonWebServic
ss_1 << Aws::String(reinterpret_cast<const char*>(val.value().ptr), val.value().len);
}
}
m_blobList.push_back(ss_1.str());
m_blobList.push_back(Aws::Utils::ByteBuffer(ss_1.str()));
ss_1.clear();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ Aws::String SimpleScalarPropertiesRequest::SerializePayload() const {

Aws::Http::HeaderValueCollection SimpleScalarPropertiesRequest::GetRequestSpecificHeaders() const {
Aws::Http::HeaderValueCollection headers;
headers.emplace("smithy-protocol", "rpc-v2-cbor");
headers.emplace(Aws::Http::CONTENT_TYPE_HEADER, Aws::CBOR_CONTENT_TYPE);
headers.emplace(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
headers.emplace(Aws::Http::ACCEPT_HEADER, Aws::CBOR_CONTENT_TYPE);
Aws::StringStream ss;
if (m_requestIdHasBeenSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ SimpleScalarPropertiesResult& SimpleScalarPropertiesResult::operator=(
ss << Aws::String(reinterpret_cast<const char*>(val.value().ptr), val.value().len);
}
}
m_blobValue = ss.str();
m_blobValue = Aws::Utils::ByteBuffer(ss.str());
ss.clear();
}
}
Expand Down Expand Up @@ -421,7 +421,7 @@ SimpleScalarPropertiesResult& SimpleScalarPropertiesResult::operator=(
ss << Aws::String(reinterpret_cast<const char*>(val.value().ptr), val.value().len);
}
}
m_blobValue = ss.str();
m_blobValue = Aws::Utils::ByteBuffer(ss.str());
ss.clear();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace Aws
static const char AMZN_XML_CONTENT_TYPE[] = "application/xml";
static const char AMZN_EVENTSTREAM_CONTENT_TYPE[] = "application/vnd.amazon.eventstream";
static const char CBOR_CONTENT_TYPE[] = "application/cbor";
static const char RPC_V2_CBOR[] = "rpc-v2-cbor";

/**
* High-level abstraction over AWS requests. GetBody() calls SerializePayload() and uses a stringbuf under the hood.
Expand Down
1 change: 1 addition & 0 deletions src/aws-cpp-sdk-core/include/aws/core/client/UserAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum class UserAgentFeature {
CREDENTIALS_SSO,
CREDENTIALS_SSO_LEGACY,
CREDENTIALS_PROFILE_SOURCE_PROFILE,
PROTOCOL_RPC_V2_CBOR,
};

class AWS_CORE_API UserAgent {
Expand Down
1 change: 1 addition & 0 deletions src/aws-cpp-sdk-core/include/aws/core/http/HttpRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace Aws
extern AWS_CORE_API const char AWS_TRAILER_HEADER[];
extern AWS_CORE_API const char SDK_INVOCATION_ID_HEADER[];
extern AWS_CORE_API const char SDK_REQUEST_HEADER[];
extern AWS_CORE_API const char SMITHY_PROTOCOL_HEADER[];
extern AWS_CORE_API const char X_AMZN_TRACE_ID_HEADER[];
extern AWS_CORE_API const char CHUNKED_VALUE[];
extern AWS_CORE_API const char AWS_CHUNKED_VALUE[];
Expand Down
5 changes: 5 additions & 0 deletions src/aws-cpp-sdk-core/source/client/AWSClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,11 @@ void AWSClient::BuildHttpRequest(const Aws::AmazonWebServiceRequest& request, co
}
}

if (httpRequest->HasHeader(Aws::Http::SMITHY_PROTOCOL_HEADER))
{
request.AddUserAgentFeature(Aws::Client::UserAgentFeature::PROTOCOL_RPC_V2_CBOR);
}

// Pass along handlers for processing data sent/received in bytes
httpRequest->SetHeadersReceivedEventHandler(request.GetHeadersReceivedEventHandler());
httpRequest->SetDataReceivedEventHandler(request.GetDataReceivedEventHandler());
Expand Down
1 change: 1 addition & 0 deletions src/aws-cpp-sdk-core/source/client/UserAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const std::pair<UserAgentFeature, const char*> BUSINESS_METRIC_MAPPING[] = {
{UserAgentFeature::CREDENTIALS_SSO, "s"},
{UserAgentFeature::CREDENTIALS_SSO_LEGACY, "u"},
{UserAgentFeature::CREDENTIALS_PROFILE_SOURCE_PROFILE, "p"},
{UserAgentFeature::PROTOCOL_RPC_V2_CBOR, "M"},
};

const std::pair<const char*, UserAgentFeature> RETRY_FEATURE_MAPPING[] = {
Expand Down
1 change: 1 addition & 0 deletions src/aws-cpp-sdk-core/source/http/HttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace Aws
const char AWS_TRAILER_HEADER[] = "x-amz-trailer";
const char SDK_INVOCATION_ID_HEADER[] = "amz-sdk-invocation-id";
const char SDK_REQUEST_HEADER[] = "amz-sdk-request";
const char SMITHY_PROTOCOL_HEADER[] = "smithy-protocol";
const char CHUNKED_VALUE[] = "chunked";
const char AWS_CHUNKED_VALUE[] = "aws-chunked";
const char X_AMZN_TRACE_ID_HEADER[] = "X-Amzn-Trace-Id";
Expand Down
25 changes: 25 additions & 0 deletions tests/aws-cpp-sdk-core-tests/aws/client/AWSClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <aws/core/utils/logging/LogMacros.h>
#include <aws/core/client/AWSErrorMarshaller.h>
#include <aws/core/utils/xml/XmlSerializer.h>
#include <aws/core/AmazonSerializableWebServiceRequest.h>


using namespace Aws;
Expand Down Expand Up @@ -519,6 +520,30 @@ TEST_F(AWSClientTestSuite, TestRecursionDetection)
mockHttpClient->Reset();
}
}

TEST_F(AWSClientTestSuite, TestCborUserAgent)
{
HeaderValueCollection responseHeaders;
AmazonWebServiceRequestMock request;
request.SetAdditionalCustomHeaderValue(Aws::Http::SMITHY_PROTOCOL_HEADER, Aws::RPC_V2_CBOR);
QueueMockResponse(HttpResponseCode::OK, responseHeaders);
auto outcome = client->MakeRequest(request);

auto lastRequest = mockHttpClient->GetMostRecentHttpRequest();
EXPECT_TRUE(lastRequest.HasUserAgent());
const auto& userAgent = lastRequest.GetUserAgent();
EXPECT_TRUE(!userAgent.empty());

const auto userAgentParsed = Aws::Utils::StringUtils::Split(userAgent, ' ');

EXPECT_TRUE(!Aws::Client::UserAgent::BusinessMetricForFeature(UserAgentFeature::PROTOCOL_RPC_V2_CBOR).empty());
// Check for CBOR protocol business metric (M) in user agent
auto businessMetrics = std::find_if(userAgentParsed.begin(), userAgentParsed.end(),
[](const Aws::String& value) { return value.find("m/") != Aws::String::npos && value.find(Aws::Client::UserAgent::BusinessMetricForFeature(UserAgentFeature::PROTOCOL_RPC_V2_CBOR)) != Aws::String::npos; });

EXPECT_TRUE(businessMetrics != userAgentParsed.end());

}
using namespace Aws::Utils::Xml;
TEST_F(XMLClientTestSuite, TestErrorInBodyOfResponse)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
@Data
public class Metadata {
private static List<String> supportedProtocols = ImmutableList.of(
"smithy-rpc-v2-cbor",
"json",
"rest-json",
"rest-xml",
"query",
"ec2",
"smithy-rpc-v2-cbor"
"ec2"
);

private String apiVersion;
Expand Down Expand Up @@ -72,6 +72,11 @@ public String findFirstSupportedProtocol() {
return protocol;
}

//We're releasing CBOR so current services (only arc-region-switch) need to opt into the new protocol priority
if (serviceFullName != null && serviceFullName.equalsIgnoreCase("ARC - Region switch")){
return "json";
}

return protocols.stream().filter(supportedProtocols::contains)
.min(Comparator.comparingInt(protocolName -> supportedProtocols.indexOf(protocolName)))
.orElseThrow(() -> new RuntimeException(String.format("No supported protocol found for %s", serviceFullName)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ protected SdkFileEntry generateModelSourceFile(ServiceModel serviceModel, Map.En
HashMap<String, String> headersMap = new HashMap<>(10);
headersMap.put("Aws::Http::CONTENT_TYPE_HEADER", "Aws::AMZN_EVENTSTREAM_CONTENT_TYPE");
headersMap.put("Aws::Http::ACCEPT_HEADER", "Aws::AMZN_EVENTSTREAM_CONTENT_TYPE");
headersMap.put("\"smithy-protocol\"", "\"rpc-v2-cbor\"");
headersMap.put("Aws::Http::SMITHY_PROTOCOL_HEADER", "Aws::RPC_V2_CBOR");
context.put("requestSpecificHeaders", headersMap);
}
template = velocityEngine.getTemplate("/com/amazonaws/util/awsclientgenerator/velocity/cpp/StreamRequestSource.vm", StandardCharsets.UTF_8.name());
}
else if (shape.isRequest()) {
Map<String, String> cborSpecificHeaders = new HashMap<>();
cborSpecificHeaders.put("Aws::Http::ACCEPT_HEADER", "Aws::CBOR_CONTENT_TYPE");
cborSpecificHeaders.put("\"smithy-protocol\"", "\"rpc-v2-cbor\"");
cborSpecificHeaders.put("Aws::Http::SMITHY_PROTOCOL_HEADER", "Aws::RPC_V2_CBOR");
if(shape.hasMembers()){
cborSpecificHeaders.put("Aws::Http::CONTENT_TYPE_HEADER", "Aws::CBOR_CONTENT_TYPE");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if(peekType_${recursionDepth}.has_value()){
ss_${recursionDepth} << Aws::String(reinterpret_cast<const char*>(${containerVar}.value().ptr), ${containerVar}.value().len);
}
}
${value}.push_back(ss_${recursionDepth}.str());
${value}.push_back(Aws::Utils::ByteBuffer(ss_${recursionDepth}.str()));
ss_${recursionDepth}.clear();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if(peekType_${recursionDepth}){
ss_${recursionDepth} << Aws::String(reinterpret_cast<const char*>(${containerVar}.value().ptr), ${containerVar}.value().len);
}
}
${value}[keyStr_${recursionDepth}] = ss_${recursionDepth}.str();
${value}[keyStr_${recursionDepth}] = Aws::Utils::ByteBuffer(ss_${recursionDepth}.str());
ss_${recursionDepth}.clear();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (peekType.has_value()) {
ss << Aws::String(reinterpret_cast<const char*>(${containerVar}.value().ptr), ${containerVar}.value().len);
}
}
${memberVarName} = ss.str();
${memberVarName} = Aws::Utils::ByteBuffer(ss.str());
ss.clear();
}
}
Expand Down
Loading
Loading