Repository navigation
Why this simple example fails? #266
Answered
by
jplatte
frederikhors
asked this question in
Q&A
|
I created a reproduction here: https://github.com/frederikhors/aide_crate_issue. I have the below code. It errors with: if I use the other use aide::axum::{ApiRouter, IntoApiResponse, routing::post};
use axum::Json;
use state::AppState;
use std::sync::Arc;
#[derive(serde::Deserialize, schemars::JsonSchema)]
struct User {
name: String,
}
async fn hello_user(Json(user): Json<User>) -> impl IntoApiResponse {
format!("hello {}", user.name)
}
// async fn hello_user() -> impl IntoApiResponse {
// format!("hello")
// }
// #[axum::debug_handler]
pub fn tryme() -> ApiRouter<Arc<AppState>> {
ApiRouter::new().api_route("/hello", post(hello_user).into())
} |
Answered by
jplatte
Dec 4, 2025
Replies: 1 comment 1 reply
|
I created a reproduction here: https://github.com/frederikhors/aide_crate_issue. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
aide v0.15.1 uses schemars 0.9.x. Please either downgrade schemars, or upgrade aide to v0.16.x (currently in alpha).