-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support query compatible trait only for json protocol #3204
Conversation
@@ -602,12 +602,16 @@ namespace Aws | |||
SSOCredentialsClient::SSOCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration, Aws::Http::Scheme scheme, const Aws::String& region) | |||
: AWSHttpResourceClient(clientConfiguration, SSO_RESOURCE_CLIENT_LOG_TAG) | |||
{ | |||
SetErrorMarshaller(Aws::MakeUnique<Aws::Client::JsonErrorMarshaller>(SSO_RESOURCE_CLIENT_LOG_TAG)); | |||
(Aws::MakeUnique<Aws::Client::JsonErrorMarshaller>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
why this file is even changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. I will revert this
@@ -356,6 +358,7 @@ namespace Aws | |||
Aws::String m_serviceName = "AWSBaseClient"; | |||
Aws::Client::RequestCompressionConfig m_requestCompressionConfig; | |||
Aws::Vector<std::shared_ptr<smithy::interceptor::Interceptor>> m_interceptors; | |||
Aws::Http::HeaderValueCollection m_featureHeaders; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess smithy client needs to be updated as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I will extend this to smithy client
@@ -56,7 +56,7 @@ jobs: | |||
run: | | |||
clang-format --version | |||
if [ -s diff_output.patch ]; then | |||
python3 clang-format-diff.py -p1 -style=file:.clang-format < diff_output.patch > formatted_differences.patch 2> error.log || true | |||
python3 clang-format-diff.py -iregex '.*\.(cpp|cc|c\+\+|cxx|c|h|hh|hpp)' -p1 -style=file:.clang-format < diff_output.patch > formatted_differences.patch 2> error.log || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this just the java file fails clang format in the pipeline, locally , no matter which version
src/aws-cpp-sdk-core/include/smithy/client/AwsSmithyClientBase.h
Outdated
Show resolved
Hide resolved
src/aws-cpp-sdk-core/include/smithy/client/AwsSmithyClientBase.h
Outdated
Show resolved
Hide resolved
@@ -39,6 +39,9 @@ namespace ${serviceNamespace} | |||
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::CONTENT_TYPE_HEADER, ${CppViewHelper.computeRequestContentType($metadata)} )); | |||
#if($metadata.acceptHeader) | |||
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::ACCEPT_HEADER, "${metadata.acceptHeader}")); | |||
#end | |||
#if ($metadata.awsQueryCompatible) | |||
headers.emplace(Aws::Http::HeaderValuePair(Aws::Http::X_AMZN_QUERY_MODE,"True")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the specification uses lowercase "true" here.
while http headers must be case-insensitive, I'd prefer to be consistent "just in case".
@@ -21,6 +21,9 @@ namespace ${serviceNamespace} | |||
class ${CppViewHelper.computeExportValue($metadata.classNamePrefix)} $className : public Aws::Client::JsonErrorMarshaller | |||
{ | |||
public: | |||
#if ($metadata.awsQueryCompatible) | |||
explicit $className(bool queryCompatibilityMode) : Aws::Client::JsonErrorMarshaller(queryCompatibilityMode){} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we can make this code a little bit more maintainable using a decorator instead of a boolean. This also forces the query compatible decision to compile time and not runtime. i.e. we could do
class JsonErrorMarshallerQueryCompatible: public JsonErrorMarshaller {
public:
AWSError<CoreErrors> Marshall(const Aws::Http::HttpResponse& response) const override {
//do special query compatible stuff
}
AWSError<CoreErrors> BuildAWSError(const std::shared_ptr<Http::HttpResponse>& httpResponse) const override {
//do special query compatible stuff
}
};
then at code generation time we could do
explicit $className : public Aws::Client::JsonErrorMarshallerQueryCompatible
and avoid passing around true and falses
Issue #, if available:
Description of changes:
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.