diff --git a/CHANGELOG.md b/CHANGELOG.md index 49b61ae..9b6f4b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,29 @@ ### Fixed +## axum-valid 0.13.0 (2023-12-14) + +### Added + +### Changed + +* Update axum-serde from 0.1.0 to 0.2.0 + +### Fixed + +## axum-valid 0.12.0 (2023-12-04) + +### Added + +* Add Support for Xml, Toml from axum-serde. + +### Changed + +* Update axum from 0.6 to 0.7. +* Use axum-serde instead of axum-yaml and axum-msgpack. + +### Fixed + ## axum-valid 0.11.0 (2023-10-21) ### Added diff --git a/Cargo.toml b/Cargo.toml index ca07d85..9129c21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "axum-valid" -version = "0.13.0" +version = "0.14.0" description = "Provides validation extractors for your Axum application, allowing you to validate data using validator, garde, validify or all of them." authors = ["GengTeng "] license = "MIT" @@ -47,6 +47,10 @@ optional = true version = "1.0.193" optional = true +[dependencies.aide] +version = "0.13.0" +optional = true + [dev-dependencies] anyhow = "1.0.72" axum = { version = "0.7.1", features = ["macros"] } @@ -92,3 +96,4 @@ full_validator = ["validator", "all_types", "422", "into_json"] full_garde = ["garde", "all_types", "422", "into_json"] full_validify = ["validify", "all_types", "422", "into_json"] full = ["full_validator", "full_garde", "full_validify"] +aide = ["dep:aide", "aide/macros"] diff --git a/src/garde.rs b/src/garde.rs index 71610c1..f16ce0c 100644 --- a/src/garde.rs +++ b/src/garde.rs @@ -25,6 +25,7 @@ use std::ops::{Deref, DerefMut}; /// If using arguments, you must pass the arguments to Garde extractor via state, meaning implementing `FromRef` for your validation arguments type. /// #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct Garde(pub E); impl Deref for Garde { diff --git a/src/validator.rs b/src/validator.rs index a02fd0b..dca0a24 100644 --- a/src/validator.rs +++ b/src/validator.rs @@ -28,6 +28,7 @@ use validator::{Validate, ValidateArgs, ValidationErrors}; /// For examples with custom extractors, check out the `tests/custom.rs` file. /// #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct Valid(pub E); impl Deref for Valid { @@ -71,6 +72,7 @@ impl Valid { /// Although current module documentation predominantly showcases `Valid` examples, the usage of `ValidEx` is analogous. /// #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct ValidEx(pub E, pub A); impl Deref for ValidEx { diff --git a/src/validify.rs b/src/validify.rs index 9d7cb29..4e4a830 100644 --- a/src/validify.rs +++ b/src/validify.rs @@ -24,6 +24,7 @@ use validify::{Modify, Validate, ValidationErrors, Validify}; /// It only does validation, usage is similar to `Valid`. /// #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct Validated(pub E); impl Deref for Validated { @@ -73,6 +74,7 @@ impl Validated { /// /// This allows applying modifications during response conversion by leveraging validify. #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct Modified(pub E); impl Deref for Modified { @@ -121,6 +123,7 @@ impl IntoResponse for Modified { /// And can treat missing fields as validation errors. /// #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct Validified(pub E); impl Deref for Validified { @@ -160,6 +163,7 @@ impl Validified { /// Suitable for inner extractors not based on `serde`. /// #[derive(Debug, Clone, Copy, Default)] +#[cfg_attr(feature = "aide", derive(aide::OperationIo))] pub struct ValidifiedByRef(pub E); impl Deref for ValidifiedByRef {