Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ 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
- Fix `serde_valid` integration to support serde_valid >=2.0.2.
Comment thread
dsteeley marked this conversation as resolved.
- If you use `#[validate(enumerate = ...)]` on a `ByteArray` or `Nullable<T>` 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
Expand Down Expand Up @@ -239,7 +248,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
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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 = [
Expand Down
11 changes: 4 additions & 7 deletions src/base64_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down Expand Up @@ -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 = ".*=")]
Expand Down
4 changes: 2 additions & 2 deletions src/nullable_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>);
impl_generic_composited_validation_nullable!(Enum<T>);

/// Serde helper function to create a default `Option<Nullable<T>>` while
/// deserializing
Expand Down Expand Up @@ -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)]
Expand Down
Loading