Skip to content

Conversation

@drganjoo
Copy link
Contributor

@drganjoo drganjoo commented Nov 2, 2025

Summary

  • Add missing From implementation for aws_smithy_types::error::operation::BuildError to ResponseRejection enum in aws_json protocol
  • Add test to verify AwsJson protocols compile with streaming operations
  • Bump aws-smithy-http-server version from 0.65.8 to 0.65.9

Motivation

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 occurs specifically in operations with streaming blob outputs where the payload serialization can return a BuildError.

Changes

  • Added Build variant to ResponseRejection enum in rust-runtime/aws-smithy-http-server/src/protocol/aws_json/rejection.rs
  • Added AwsJsonCompilationTest to verify the fix works for both AwsJson1.0 and AwsJson1.1
  • Verified test fails without the fix by commenting out the Build variant
  • Bumped crate version to 0.65.9 in rust-runtime/aws-smithy-http-server/Cargo.toml
  • Added changelog entry in .changelog/1762045039.md

This change aligns the aws_json protocol with other protocols like rest_json_1 which already have this variant.

Test plan

  • Added compilation test that verifies AwsJson protocols work with streaming operations
  • Verified test fails without the fix
  • Verified test passes with the fix
  • Ran ktlintFormat to ensure code style compliance

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 <[email protected]>
@drganjoo drganjoo requested review from a team as code owners November 2, 2025 01:02
@github-actions
Copy link

github-actions bot commented Nov 2, 2025

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • Server Test Python (ignoring whitespace)
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.


#[derive(Debug, Error)]
pub enum ResponseRejection {
#[error("error building HTTP response: {0}")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

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.

2 participants