Skip to content

Commit bdc3673

Browse files
authored
Merge pull request #176 from Metaswitch/serde_valid_any_one_of
Support `serde_valid::Validate` for `OneOf` and `AnyOf` types.
2 parents 23fa6c4 + 637de56 commit bdc3673

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
### Fixed
1313

14+
## [6.5.0] - 2024-05-09
15+
### Added
16+
- Support `serde_valid::Validate` for `OneOf` and `AnyOf` types.
17+
1418
## [6.4.1] - 2023-09-05
1519
### Fixed
1620
- Fixed documentation build breakage on stable
@@ -209,7 +213,8 @@ No changes. We now think we've got enough to declare this crate stable.
209213
## [0.5.0] - 2017-09-18
210214
- Start of changelog.
211215

212-
[Unreleased]: https://github.com/Metaswitch/swagger-rs/compare/6.4.1...HEAD
216+
[Unreleased]: https://github.com/Metaswitch/swagger-rs/compare/6.5.0...HEAD
217+
[6.5.0]: https://github.com/Metaswitch/swagger-rs/compare/6.4.1...6.5.0
213218
[6.4.1]: https://github.com/Metaswitch/swagger-rs/compare/6.4.0...6.4.1
214219
[6.4.0]: https://github.com/Metaswitch/swagger-rs/compare/6.3.0...6.4.0
215220
[6.3.0]: https://github.com/Metaswitch/swagger-rs/compare/6.2.1...6.3.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "swagger"
3-
version = "6.4.1"
3+
version = "6.5.0"
44
authors = ["Metaswitch Networks Ltd"]
55
license = "Apache-2.0"
66
description = "A set of common utilities for Rust code generated by OpenAPI Generator"

src/one_any_of.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use serde::{
66
Deserialize, Deserializer, Serialize, Serializer,
77
__private::de::{Content, ContentRefDeserializer},
88
};
9+
#[cfg(feature = "serdevalid")]
10+
use serde_valid::Validate;
911
use std::str::FromStr;
1012
use std::string::ToString;
1113

@@ -19,6 +21,7 @@ macro_rules! common_one_any_of {
1921
) => {
2022
#[doc = concat!("`", stringify!($t), "` type.\n\nThis allows modelling of ", stringify!($schema), " JSON schemas.")]
2123
#[cfg_attr(feature = "conversion", derive(LabelledGenericEnum))]
24+
#[cfg_attr(feature = "serdevalid", derive(Validate))]
2225
#[derive(Debug, PartialEq, Clone)]
2326
pub enum $t<$($i),*> where
2427
$($i: PartialEq,)*

0 commit comments

Comments
 (0)