Axum custom request extractor and validator using FromRequest

This post documents what I learned about creating custom Axum extractor which can be used with the validator for validation. Create a new test project: ➜ cargo new request-validator cd request-validator The first crate to be added is axum for Axum framework. request-validator on  main [?] via 🦀 v1.79.0 ➜ cargo add axum Updating crates.io index Adding axum v0.7.5 to dependencies Features: + form + http1 + json + matched-path + original-uri + query + tokio + tower-log + tracing - __private_docs - http2 - macros - multipart - ws Updating crates....

July 12, 2024 · 5 min · 988 words · kenno