diff --git a/poem-openapi-derive/src/api.rs b/poem-openapi-derive/src/api.rs index ae29723d85..33bcd43b8a 100644 --- a/poem-openapi-derive/src/api.rs +++ b/poem-openapi-derive/src/api.rs @@ -400,8 +400,10 @@ fn generate_operation( request_meta.push(quote! { if <#arg_ty as #crate_name::ApiExtractor>::TYPES.contains(&#crate_name::ApiExtractorType::RequestObject) { request = <#arg_ty as #crate_name::ApiExtractor>::request_meta(); - if let Some(ref mut request) = request.as_mut() { - request.description = #param_desc; + if let ::std::option::Option::Some(ref mut request) = request.as_mut() { + if request.description.is_none() { + request.description = #param_desc; + } } } }); diff --git a/poem-openapi/CHANGELOG.md b/poem-openapi/CHANGELOG.md index 20c20b6aad..a4e586bfdd 100644 --- a/poem-openapi/CHANGELOG.md +++ b/poem-openapi/CHANGELOG.md @@ -4,6 +4,12 @@ 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). +#[5.1.4] 2024-11-25 + +- Assign the description to the request object in OpenAPI [#886](https://github.com/poem-web/poem/pull/886) +- Implemented nullable fields for openapi spec generation [#865](https://github.com/poem-web/poem/pull/865) +- refactor: change type name delimiters from `<>` `()` `[]` to `_` [#904](https://github.com/poem-web/poem/pull/904) + #[5.1.3] 2024-11-20 - Update MSRV to `1.81.0` diff --git a/poem-openapi/Cargo.toml b/poem-openapi/Cargo.toml index 57b95a25b3..e7756ddbea 100644 --- a/poem-openapi/Cargo.toml +++ b/poem-openapi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "poem-openapi" -version = "5.1.3" +version = "5.1.4" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/poem-openapi/tests/object.rs b/poem-openapi/tests/object.rs index 578c1705e5..924e3be7c7 100644 --- a/poem-openapi/tests/object.rs +++ b/poem-openapi/tests/object.rs @@ -43,10 +43,7 @@ fn generics() { delete_user: T2, } - assert_eq!( - >::name(), - "Obj_integer_int32_integer_int64" - ); + assert_eq!(>::name(), "Obj_integer_int32_integer_int64"); let meta = get_meta::>(); assert_eq!(meta.properties[0].1.unwrap_inline().ty, "integer"); assert_eq!(meta.properties[0].1.unwrap_inline().format, Some("int32")); @@ -54,10 +51,7 @@ fn generics() { assert_eq!(meta.properties[1].1.unwrap_inline().ty, "integer"); assert_eq!(meta.properties[1].1.unwrap_inline().format, Some("int64")); - assert_eq!( - >::name(), - "Obj_number_float_number_double" - ); + assert_eq!(>::name(), "Obj_number_float_number_double"); let meta = get_meta::>(); assert_eq!(meta.properties[0].1.unwrap_inline().ty, "number"); assert_eq!(meta.properties[0].1.unwrap_inline().format, Some("float")); diff --git a/poem/CHANGELOG.md b/poem/CHANGELOG.md index b1d6e6571e..5d499451b9 100644 --- a/poem/CHANGELOG.md +++ b/poem/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # [3.1.5] 2024-11-25 - Bump `opentelemetry` to `0.27.0` +- Add WebSocketStream::get_config method to get the WebSocket configuration. [#900](https://github.com/poem-web/poem/pull/900) +- feat: implement conversion from libcookie to poem cookie [#898](https://github.com/poem-web/poem/pull/898) # [3.1.4] 2024-11-20