Conversation
|
Why not add a dev-dependency on axum with the tokio feature? Then axum::serve can be used in doctests. |
|
axum::serve isn't enabled by tokio alone. It also needs http1 or http2 / default features. Most importantly, I avoided adding extra axum features only for doctests because aide depends on axum with default-features = false, and making doctests pass via a beefier dev-dep can mask “docs don’t compile” cases for users running minimal axum features. |
I don't think this should be a serious concern nowadays. rustc has supported "this item exists, but is under a disabled |
Add axum as a dev-dependency with tokio and http1 features so that axum::serve compiles in doctests without requiring workarounds.
73110f9 to
0d96566
Compare
|
Fair point — updated the PR to add |
Summary
aide::axum,aide::redoc,aide::swagger, andaide::scalarto avoid callingaxum::serve, since it is feature-gated inaxum.IntoResponsefor the non-documented/api.jsonhandler in theaide::axumdocs example.Test Plan
cargo test -p aide --doc --all-features(Originally part of #285; split out per review feedback.)