From 6fc7a45a87bf6663b867a500f48ca39fe7da493a Mon Sep 17 00:00:00 2001 From: David Steele Date: Wed, 15 Jul 2026 11:14:36 +0100 Subject: [PATCH 1/2] chore: Update frunk and release Signed-off-by: David Steele --- CHANGELOG.md | 9 ++++++++- Cargo.toml | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3dadd0960..17f2bdefd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Changed +### Added + +### Fixed + +## [7.0.1] - 2026-07-15 ### Fixed - Fix request_parser so that macro_use is not required. - Add "external" tests to ensure backward compatibility. +- Frunk 0.5.0 ## [7.0.0] - 2025-11-12 ### Changed @@ -239,7 +245,8 @@ No changes. We now think we've got enough to declare this crate stable. ## [0.5.0] - 2017-09-18 - Start of changelog. -[Unreleased]: https://github.com/Metaswitch/swagger-rs/compare/7.0.0...HEAD +[Unreleased]: https://github.com/Metaswitch/swagger-rs/compare/7.0.1...HEAD +[7.0.1]: https://github.com/Metaswitch/swagger-rs/compare/7.0.0...7.0.1 [7.0.0]: https://github.com/Metaswitch/swagger-rs/compare/7.0.0-rc3...7.0.0 [7.0.0-rc3]: https://github.com/Metaswitch/swagger-rs/compare/7.0.0-rc2...7.0.0-rc3 [7.0.0-rc2]: https://github.com/Metaswitch/swagger-rs/compare/7.0.0-rc1...7.0.0-rc2 diff --git a/Cargo.toml b/Cargo.toml index 4d30c9b72..684c0522f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swagger" -version = "7.0.0" +version = "7.0.1" authors = ["Metaswitch Networks Ltd"] license = "Apache-2.0" description = "A set of common utilities for Rust code generated by OpenAPI Generator" @@ -39,11 +39,11 @@ bytes = "1.8.0" hyper = "1" # Conversion -frunk = { version = "0.4", optional = true } +frunk = { version = "0.5", optional = true } frunk-enum-core = { version = "0.3", optional = true } frunk-enum-derive = { version = "0.3", optional = true } -frunk_core = { version = "0.4", optional = true } -frunk_derives = { version = "0.4", optional = true } +frunk_core = { version = "0.5", optional = true } +frunk_derives = { version = "0.5", optional = true } # Client hyper-util = { version = "0.1.8", features = [ From c5433c4ebbf27c91e95660b9cce997457e4ced6a Mon Sep 17 00:00:00 2001 From: David Steele Date: Thu, 16 Jul 2026 10:31:31 +0100 Subject: [PATCH 2/2] fix: Resolve trait removals in serde_valid. Requires switching to #[validate(r#enum = ...)] Signed-off-by: David Steele --- CHANGELOG.md | 3 +++ src/base64_format.rs | 11 ++++------- src/nullable_format.rs | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17f2bdefd..546b36b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix request_parser so that macro_use is not required. - Add "external" tests to ensure backward compatibility. - Frunk 0.5.0 +- Fix `serde_valid` integration to support serde_valid >=2.0.2. + - If you use `#[validate(enumerate = ...)]` on a `ByteArray` or `Nullable` field, switch to `#[validate(r#enum = ...)]`. + **Note this is a breaking change in `serde_valid` 2.0.2, therefore we're releasing this as a fix here to retain compatibility.** ## [7.0.0] - 2025-11-12 ### Changed diff --git a/src/base64_format.rs b/src/base64_format.rs index 2f77bd360..8eda2eac5 100644 --- a/src/base64_format.rs +++ b/src/base64_format.rs @@ -70,12 +70,9 @@ impl_validate_byte_array!(MaxLength, to_string(), usize); impl_validate_byte_array!(MinLength, to_string(), usize); #[cfg(feature = "serdevalid")] -impl serde_valid::ValidateEnumerate<&'static str> for ByteArray { - fn validate_enumerate( - &self, - enumerate: &[&'static str], - ) -> Result<(), serde_valid::EnumerateError> { - self.to_string().validate_enumerate(enumerate) +impl serde_valid::ValidateEnum<&'static str> for ByteArray { + fn validate_enum(&self, enumerate: &[&'static str]) -> Result<(), serde_valid::EnumError> { + self.to_string().validate_enum(enumerate) } } @@ -130,7 +127,7 @@ mod serde_tests { #[derive(Validate)] struct ValidateByteArrayStruct { // Validate encoded as string - #[validate(enumerate = ["YWJjZGU=" ])] + #[validate(r#enum = ["YWJjZGU=" ])] #[validate(max_length = 8)] #[validate(min_length = 8)] #[validate(pattern = ".*=")] diff --git a/src/nullable_format.rs b/src/nullable_format.rs index 54276ec22..232957675 100644 --- a/src/nullable_format.rs +++ b/src/nullable_format.rs @@ -701,7 +701,7 @@ impl_generic_composited_validation_nullable!(MaxProperties, usize); #[cfg(feature = "serdevalid")] impl_generic_composited_validation_nullable!(MinProperties, usize); #[cfg(feature = "serdevalid")] -impl_generic_composited_validation_nullable!(Enumerate); +impl_generic_composited_validation_nullable!(Enum); /// Serde helper function to create a default `Option>` while /// deserializing @@ -758,7 +758,7 @@ mod serde_tests { #[derive(Validate)] struct ValidatedNullableItemsStruct { // Number validations - #[validate(enumerate = [5, 10, 15])] + #[validate(r#enum = [5, 10, 15])] #[validate(minimum = 5)] #[validate(maximum = 15)] #[validate(exclusive_minimum = 4)]