Skip to content
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

Allow payload serialization to be overridden #90

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

kstich
Copy link
Contributor

@kstich kstich commented Jan 11, 2020

This commit adds support for implementing protocols to override the
serialization behavior of a member marked with @httpPayload. This is
useful for protocols that work with intermediate objects that need to
be altered at the service level. Adding a top level xmlns attribute,
for example.

This commit also fixes various bugs found in testing behavior developed
on top of the main change.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This commit adds support for implementing protocols to override the
serialization behavior of a member marked with @httpPayload. This is
useful for protocols that work with intermediate objects that need to
be altered at the service level. Adding a top level xmlns attribute,
for example.

This commit also fixes various bugs found in testing behavior developed
on top of the main change.
@kstich kstich requested a review from mtdowling January 11, 2020 00:13
Copy link
Member

@mtdowling mtdowling left a comment

Choose a reason for hiding this comment

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

Exporting two new protected methods on top of the plethora of existing protected methods makes me nervous. Is there another way to achieve whatever it is you're going after without this requirement?

* <p>For example:
*
* <pre>{@code
* if (input.body !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

What is input?

@kstich
Copy link
Contributor Author

kstich commented Jan 13, 2020

The only other clear way to handle the scope that this change allows would be to add a single protected method to allow for arbitrarily manipulating the value currently being set in to body. This would be a function that does no work by default, executed after the current setting of that value.

Its purpose would be a little less clear, but there's potentially less chance for a downstream consumer to miss-handle processing of Payloads.

@mtdowling
Copy link
Member

Ok. I'm still not thrilled about the API surface area, but LGTM for now.

@kstich kstich merged commit c2d5e5d into master Jan 13, 2020
@kstich kstich deleted the payload_serialization_override branch January 13, 2020 19:35
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this pull request Jan 13, 2020
trivikr added a commit to aws/aws-sdk-js-v3 that referenced this pull request Jan 13, 2020
AllanZhengYP pushed a commit to AllanZhengYP/aws-sdk-js-v3 that referenced this pull request Mar 20, 2020
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this pull request Mar 20, 2020
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this pull request Mar 24, 2020
trivikr added a commit to trivikr/aws-sdk-js-v3 that referenced this pull request Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants