Skip to content

Conversation

@drganjoo
Copy link
Contributor

@drganjoo drganjoo commented Nov 2, 2025

This commit updates examples to demonstrate server SDK usage with both [email protected]
and [email protected], supporting the http-1x migration effort.

Changes

New Directories

  • legacy/: Complete set of examples using [email protected]/[email protected] with
    aws-smithy-legacy-http-server. These examples preserve the original behavior
    for users not yet ready to migrate.

  • pokemon-service-server-skd-patch/: Compatibility layer and patches for
    bridging http@0 and http@1 types in server SDK.

Updated Examples

Modified existing examples to use [email protected]/[email protected]:

  • pokemon-service: Main service example updated for http@1
  • pokemon-service-tls: TLS example with hyper 1.x compatibility
  • pokemon-service-lambda: Lambda example updated for http@1
  • pokemon-service-client-usage: Client examples updated
  • pokemon-service-common: Common utilities updated

Key Updates

  • Cargo.toml files updated with [email protected] and [email protected] dependencies
  • Server initialization code updated for hyper 1.x API changes
  • Test helpers updated to support both HTTP versions
  • Connector and middleware examples updated for new hyper API

Testing

Examples can be run with both HTTP versions to verify compatibility.

Relates to #3362

This commit updates examples to demonstrate server SDK usage with both [email protected]
and [email protected], supporting the http-1x migration effort.

## Changes

### New Directories
- **legacy/**: Complete set of examples using [email protected]/[email protected] with
  aws-smithy-legacy-http-server. These examples preserve the original behavior
  for users not yet ready to migrate.

- **pokemon-service-server-skd-patch/**: Compatibility layer and patches for
  bridging http@0 and http@1 types in server SDK.

### Updated Examples
Modified existing examples to use [email protected]/[email protected]:
- pokemon-service: Main service example updated for http@1
- pokemon-service-tls: TLS example with hyper 1.x compatibility
- pokemon-service-lambda: Lambda example updated for http@1
- pokemon-service-client-usage: Client examples updated
- pokemon-service-common: Common utilities updated

### Key Updates
- Cargo.toml files updated with [email protected] and [email protected] dependencies
- Server initialization code updated for hyper 1.x API changes
- Test helpers updated to support both HTTP versions
- Connector and middleware examples updated for new hyper API

Relates to #3362
@drganjoo drganjoo requested review from a team as code owners November 2, 2025 20:42
Provides detailed migration instructions for upgrading from [email protected]/[email protected]
to [email protected]/[email protected] including:
- Dependency updates
- Server initialization changes
- Client connector setup
- Test infrastructure improvements
- Common patterns and troubleshooting
- Complete migration checklist

## Why Upgrade?

- **Better Performance**: Hyper 1.x has improved performance and reduced allocations
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this actually true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ops! I had completely forgotten to review the file before pushing the commit - sorry.

Comment on lines +33 to +34
- **Ecosystem Alignment**: New libraries are targeting [email protected] and [email protected]
- **Security Updates**: Continued security patches for 1.x line
Copy link
Collaborator

Choose a reason for hiding this comment

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

these are the actual reasons


**After:**
```rust
use http::StatusCode;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we re-export this from the server or aws-smithy-http-server? I don't see any compelling reason to force a direct http dep.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is being re-exported from the aws-smithy-http-server: rust-runtime/aws-smithy-http-server/src/lib.rs.

Need to change the guide.

Comment on lines +222 to +224
## Client-Side Changes

### HTTP Client Connector Setup
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to call out that client/server http versions are totally decoupled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need to check with the SDK team on this section. For the time being I am removing it.

### 3. Request Handling

Most request handling code remains the same thanks to smithy-rs abstractions:

Copy link
Collaborator

Choose a reason for hiding this comment

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

probably no need to bother calling this out.

@@ -0,0 +1,54 @@
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(clippy::unnecessary_wraps)]
pub async fn de_check_health_http_request<B>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you meant to check in this entire directory

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