diff --git a/crates/aide/Cargo.toml b/crates/aide/Cargo.toml index 24e81e4..9085886 100644 --- a/crates/aide/Cargo.toml +++ b/crates/aide/Cargo.toml @@ -47,6 +47,7 @@ axum-extra-cookie = ["axum", "axum-extra", "axum-extra/cookie"] axum-extra-cookie-private = ["axum", "axum-extra", "axum-extra/cookie-private"] axum-extra-form = ["axum", "axum-extra", "axum-extra/form"] axum-extra-query = ["axum", "axum-extra", "axum-extra/query"] +axum-extra-json-deserializer = ["axum", "axum-extra", "axum-extra/json-deserializer"] axum-wasm = ["axum"] diff --git a/crates/aide/src/axum/inputs.rs b/crates/aide/src/axum/inputs.rs index 9413835..3919222 100644 --- a/crates/aide/src/axum/inputs.rs +++ b/crates/aide/src/axum/inputs.rs @@ -9,8 +9,7 @@ use crate::{ use axum::{ body::Body, extract::{ - Extension, Form, Host, Json, MatchedPath, OriginalUri, Path, Query, RawQuery, - State, + Extension, Form, Host, Json, MatchedPath, OriginalUri, Path, Query, RawQuery, State, }, }; @@ -108,6 +107,16 @@ where } } +#[cfg(feature = "axum-extra-json-deserializer")] +impl OperationInput for axum_extra::extract::JsonDeserializer +where + T: JsonSchema, +{ + fn operation_input(ctx: &mut crate::gen::GenContext, operation: &mut Operation) { + Json::::operation_input(ctx, operation); + } +} + impl OperationInput for Form where T: JsonSchema,