Add BuildError support to aws_json ResponseRejection#4375
Open
Add BuildError support to aws_json ResponseRejection#4375
Conversation
This commit adds a missing `From` implementation for `aws_smithy_types::error::operation::BuildError` to the `ResponseRejection` enum in the aws_json protocol. Without this implementation, generated code that uses the `?` operator with `BuildError` (e.g., when serializing HTTP payloads for streaming operations) fails to compile with errors like: ``` the trait `From<aws_smithy_types::error::operation::BuildError>` is not implemented for `aws_json::rejection::ResponseRejection` ``` This change aligns the aws_json protocol with other protocols like rest_json_1 which already have this variant. Bump version to 0.65.9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
rcoh
reviewed
Nov 3, 2025
|
|
||
| #[derive(Debug, Error)] | ||
| pub enum ResponseRejection { | ||
| #[error("error building HTTP response: {0}")] |
Collaborator
There was a problem hiding this comment.
this is actually a breaking change because this enum is not marked non_exhaustive. I don't know how much breakage will exist in practice.
rcoh
approved these changes
Nov 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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