After upgrading to axum 0.6, all my post methods are broken #1755
-
As the title side, the post methods will generate compile error like this:
Here is one of my post methods: pub async fn wx_login(
host: HtyHostHeader,
Json(in_wx_login): Json<WxLogin>,
State(db_pool): State<Arc<DbState>>,
) -> Json<HtyResponse<WxSession>> {
debug!(":::wx_login:::");
match raw_wx_login(&host, &in_wx_login, db_pool).await {
Ok(ok) => wrap_json_ok_resp(ok),
Err(e) => wrap_json_anyhow_err(e),
}
} Nothing changed in the code(just migrate to the new Can anyone provide some help on this problem? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
https://docs.rs/axum/latest/axum/extract/index.html#the-order-of-extractors |
Beta Was this translation helpful? Give feedback.
-
async fn create_todo_handler( After changing the parameter order, the problem is still there. It works well for 0.5. |
Beta Was this translation helpful? Give feedback.
https://docs.rs/axum/latest/axum/extract/index.html#the-order-of-extractors