Closed
Description
I am upgrading from lambda_http 0.8 to 0.9.0
As a consequence, I also upgraded to axum 0.7.3`
I have a compile error on axum middleware:
Here is a minimal example:
pub async fn mw_sample_1(mut req: lambda_http::Request, next: Next) -> impl IntoResponse {
next.run(req).await
}
It gives me this error:
error: mismatched types
label: arguments to this method are incorrect
note: `lambda_http::Body` and `axum::body::Body` have similar names, but are actually distinct types
label: arguments to this method are incorrect
note: `lambda_http::Body` is defined in crate `aws_lambda_events`
label: arguments to this method are incorrect
note: `axum::body::Body` is defined in crate `axum_core`
label: arguments to this method are incorrect
note: method defined here
label: arguments to this method are incorrect
If I change the code to this, the error goes away (as expected)
pub async fn mw_sample_2(mut req: axum::extract::Request, next: Next) -> impl IntoResponse {
next.run(req).await
}
In my middleware, I need the lambda_http::Request
.
Before the upgrade, the code looked like this:
pub async fn mw_sample_old(
mut req: lambda_http::Request,
next: Next<lambda_http::Body>,
) -> impl IntoResponse {
next.run(req).await
}
Am I missing something?
Metadata
Metadata
Assignees
Labels
No labels