Add BuildError support to aws_json ResponseRejection #4375
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.
Summary
Fromimplementation foraws_smithy_types::error::operation::BuildErrortoResponseRejectionenum in aws_json protocolMotivation
Without this implementation, generated code that uses the
?operator withBuildError(e.g., when serializing HTTP payloads for streaming operations) fails to compile with errors like:This occurs specifically in operations with streaming blob outputs where the payload serialization can return a
BuildError.Changes
Buildvariant toResponseRejectionenum inrust-runtime/aws-smithy-http-server/src/protocol/aws_json/rejection.rsAwsJsonCompilationTestto verify the fix works for both AwsJson1.0 and AwsJson1.1rust-runtime/aws-smithy-http-server/Cargo.toml.changelog/1762045039.mdThis change aligns the aws_json protocol with other protocols like rest_json_1 which already have this variant.
Test plan