diff --git a/Cargo.toml b/Cargo.toml index 0291523482..f654247267 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ rust-version = "1.75" [workspace.dependencies] poem = { path = "poem", version = "3.1.0", default-features = false } poem-derive = { path = "poem-derive", version = "3.1.0" } -poem-openapi-derive = { path = "poem-openapi-derive", version = "5.1.0" } +poem-openapi-derive = { path = "poem-openapi-derive", version = "5.1.1" } poem-grpc-build = { path = "poem-grpc-build", version = "0.5.0" } proc-macro-crate = "3.0.0" diff --git a/examples/poem/redis-session/Cargo.toml b/examples/poem/redis-session/Cargo.toml index 98ba74ce2e..96eba1a330 100644 --- a/examples/poem/redis-session/Cargo.toml +++ b/examples/poem/redis-session/Cargo.toml @@ -8,7 +8,7 @@ publish.workspace = true poem = { workspace = true, features = ["redis-session"] } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } tracing-subscriber.workspace = true -redis = { version = "0.26.0", features = [ +redis = { version = "0.27", features = [ "aio", "tokio-comp", "connection-manager", diff --git a/poem-openapi-derive/Cargo.toml b/poem-openapi-derive/Cargo.toml index 13ff8c2ff8..08c7d59b66 100644 --- a/poem-openapi-derive/Cargo.toml +++ b/poem-openapi-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "poem-openapi-derive" -version = "5.1.0" +version = "5.1.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/poem-openapi/CHANGELOG.md b/poem-openapi/CHANGELOG.md index 6a58ef0da7..c6f31521a7 100644 --- a/poem-openapi/CHANGELOG.md +++ b/poem-openapi/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - implements `Serialize` and `Deserialize` for `poem_openapi::types::Any`. +# [5.1.1] 2024-09-13 + +- fix [#883](https://github.com/poem-web/poem/issues/883) + # [5.1.0] 2024-09-08 - fix read_only_with_default test when only default features are enabled [#854](https://github.com/poem-web/poem/pulls) diff --git a/poem-openapi/Cargo.toml b/poem-openapi/Cargo.toml index f001ce119f..ce65c0dfd4 100644 --- a/poem-openapi/Cargo.toml +++ b/poem-openapi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "poem-openapi" -version = "5.1.0" +version = "5.1.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/poem-openapi/src/types/external/bson.rs b/poem-openapi/src/types/external/bson.rs index f51e0fdbee..cec396ff3f 100644 --- a/poem-openapi/src/types/external/bson.rs +++ b/poem-openapi/src/types/external/bson.rs @@ -62,7 +62,7 @@ impl ParseFromMultipartField for ObjectId { impl ToJSON for ObjectId { fn to_json(&self) -> Option { - Some(serde_json::to_value(self).unwrap()) + serde_json::to_value(self).ok() } } diff --git a/poem-openapi/src/types/external/floats.rs b/poem-openapi/src/types/external/floats.rs index cb387f3874..7f80cfe5f1 100644 --- a/poem-openapi/src/types/external/floats.rs +++ b/poem-openapi/src/types/external/floats.rs @@ -71,7 +71,7 @@ macro_rules! impl_type_for_floats { impl ToJSON for $ty { fn to_json(&self) -> Option { - Some(Value::Number(Number::from_f64(*self as f64).unwrap())) + Number::from_f64(*self as f64).map(Value::Number) } } diff --git a/poem-openapi/src/types/external/time.rs b/poem-openapi/src/types/external/time.rs index 51f0dc37c8..1d34d19006 100644 --- a/poem-openapi/src/types/external/time.rs +++ b/poem-openapi/src/types/external/time.rs @@ -69,7 +69,7 @@ impl ParseFromMultipartField for OffsetDateTime { impl ToJSON for OffsetDateTime { fn to_json(&self) -> Option { - Some(Value::String(self.format(&Rfc3339).unwrap_or_default())) + self.format(&Rfc3339).ok().map(Value::String) } } @@ -129,7 +129,7 @@ macro_rules! impl_naive_datetime_types { impl ToJSON for $ty { fn to_json(&self) -> Option { - Some(Value::String(self.format($format_description).unwrap())) + self.format($format_description).ok().map(Value::String) } } }; diff --git a/poem/CHANGELOG.md b/poem/CHANGELOG.md index c04e0e7137..0bdcf5516b 100644 --- a/poem/CHANGELOG.md +++ b/poem/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# [3.1.0] 2024-09-28 +# [3.1.0] 2024-09-08 - build(deps): update nix requirement from 0.28.0 to 0.29.0 [#851](https://github.com/poem-web/poem/pull/851) - Add manual `Default` implementation for `#[handler]` [#848](https://github.com/poem-web/poem/pull/848) diff --git a/poem/Cargo.toml b/poem/Cargo.toml index 3d789c2f28..d337475339 100644 --- a/poem/Cargo.toml +++ b/poem/Cargo.toml @@ -118,7 +118,7 @@ chrono = { workspace = true, optional = true, default-features = false, features time = { version = "0.3", optional = true } mime_guess = { version = "2.0.3", optional = true } rand = { version = "0.8.4", optional = true } -redis = { version = "0.26.0", optional = true, features = [ +redis = { version = "0.27", optional = true, features = [ "aio", "tokio-comp", "connection-manager",