-
Notifications
You must be signed in to change notification settings - Fork 811
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
Move Aws specific responseHandler related classes to aws-core #484
Conversation
@@ -13,7 +13,7 @@ | |||
* permissions and limitations under the License. | |||
*/ | |||
|
|||
package software.amazon.awssdk.core.internal.http; | |||
package software.amazon.awssdk.awscore.protocol.json; |
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.
Should we rename CompositeErrorCodeParser and ErrorCodeParser to include Json in the name?
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.
We already have JsonErrorCodeParser
though.
ErrorCodeParser
is an interface and JsonErrorCodeParser
and IonErrorCodeParser
, CompositeErrorCodeParser
are the implementations.
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.
Maybe StructuredErrorCodeParser if we are sticking with the naming elsewhere?
@@ -13,7 +13,7 @@ | |||
* permissions and limitations under the License. | |||
*/ | |||
|
|||
package software.amazon.awssdk.core.internal.http; | |||
package software.amazon.awssdk.awscore.protocol.json; |
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.
Eww this ION parser is gross. Can we add a review before release to revisit ION?
@@ -22,9 +22,9 @@ | |||
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON) | |||
.requestUri("/").httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true).build(); | |||
|
|||
private final SdkJsonProtocolFactory protocolFactory; | |||
private final AwsJsonProtocolFactory protocolFactory; |
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.
Do these need to use the Aws specific one? Does that mean we have to branch marshallers for APIG?
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.
AwsJsonProtocolFactory
can have different JSON marshallers(ION, JSON, CBOR) and SdkJsonProtocolFactory
only supports Json now.
No, they are still sharing the same marshallers/unmarshallers defined in SdkStructuredPlainJsonFactory
.
@@ -31,7 +31,6 @@ | |||
@FunctionalInterface | |||
public interface HttpResponseHandler<T> { | |||
|
|||
//TODO: move this to aws-core module once HttpResponse is replaced with SdkHttpResponse |
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.
No longer accurate?
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.
Yeah, found out APIG Api returns the AWS request id header as well.
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.core.protocol; |
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.
Should this be protocol.json?
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.
yup, good catch
/** | ||
* Content type resolver implementation for Ion-enabled services. | ||
*/ | ||
JsonContentTypeResolver ION_BINARY = new JsonContentTypeResolverImpl("application/x-amz-ion-"); |
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.
For stuff like this I don't necessarily care where it lives. It can be in core if that means we can hide the impl from module boundaries. Don't care either way though.
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.
Yeah, agreed. kindof weird to make impl public.
private static final JsonFactory CBOR_FACTORY = new CBORFactory(); | ||
protected static final JsonFactory CBOR_FACTORY = new CBORFactory(); | ||
|
||
protected static final BiFunction<JsonFactory, String, StructuredJsonGenerator> GENERATOR_SUPPLIER = |
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.
Might be advantageous to have a subinterface of BiFunction that gives the params better names. Didn't immediately grok what String could be without looking at the diff.
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.
makes sense
347ae51
to
0925f4b
Compare
0925f4b
to
838d098
Compare
…498f53e0 Pull request: release <- staging/7f9c1113-3bb2-4faf-999d-9f68498f53e0
Description
Part2 of #27
Moving xml protocol and AWS JSON protocol related classes(response handler, unmarshaller/marshaller) to aws-core.
Testing
mvn clean install
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsLicense