I dont understand this #1147
-
i have this code pub fn router() -> OpenApiRouter {
let router = Router::new()
.route("/", get(login));
OpenApiRouter::new().nest(
"/v1/auth",
OpenApiRouter::new()
.routes(routes!(login))
.routes(routes!(sing_up)),
)
}
#[derive(Deserialize, ToSchema, Debug)]
struct LoginRequest {
pub password: String,
}
#[utoipa::path(
post,
path = "/login",
responses(
(status = OK, description = "text", content_type = "text/plain")
),
tag = AUTHENTICATION_TAG
)]
async fn login(
State(config): State<Arc<Config>>,
Json(body): Json<LoginRequest>,
) -> &'static str {
info!("config: {config:#?}");
info!("body: {body:#?}");
"login"
} The Axum part, including the router, works, but the OpenApiRouter part has an error that I don't understand.
|
Beta Was this translation helpful? Give feedback.
Answered by
TN19Nworking
Oct 17, 2024
Replies: 1 comment
-
I just found out it's an Axum thing. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
TN19Nworking
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just found out it's an Axum thing.