Standardize the way SdkBytes are unmarshalled when they're part of a payload and the service returns no content. #3021
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After this change, when SdkBytes are modeled as a payload, the SDK will always return a non-null empty SdkBytes. When SdkBytes are modeled as a field, they will be null if the service did not specify them.
This issue was brought to our attention when #2982 standardized the Netty HTTP client's behavior. Previously, chunked encoded responses would behave differently than non-chunked encoded payloads. While that change made the behavior consistent, it had the unintentional effect of the SDK now returning null for blob-returning operations (like Lambda's invoke) instead of an empty SdkBytes (unless the Lambda response used chunked encoding, in which case the result would have been null even under the old behavior).
This change standardizes this behavior across all protocols. The table at the end of this PR summarizes the current and new behavior.
Other changes in this PR:
* This was the behavior that was changed with #2982. Prior to that change, it would have been 'empty'.