Migrating from Warp to Axum
I have a handful of services, some in Warp and some in Rocket, and I dislike both of those frameworks. I&#x27;ve been looking into axum so this is a nice read.<p>Honestly I don&#x27;t think that Axum is right either. So for example, this:<p><pre><code>    async fn create_user(
        Json(payload): Json&lt;CreateUser&gt;,
    ) -&gt; impl IntoResponse {
         let user = User {
            id: 1337,
            username: payload.username,
        };
        (StatusCode::CREATED, Json(user))
    }
</code></pre>
For context, if you haven&#x27;t checked out Axum, this is from the Axum docs.<p>Rocket has a similar thing with its request guards, it has a similar json type that you put into the signature of a handler function and it automatically plucks the value from the body and parses it as json.<p>What&#x27;s weird to me is that it&#x27;s coupling the request and response format to the logic. What if a client wants to post this as a form body? Write a separate endpoint? What if some old clients put the arguments in the query string? When I see this snippet as one of the intro examples for Axum, it feels like a red flag to me.