Skip to content

Commit

Permalink
poem v3.1.5
Browse files Browse the repository at this point in the history
poem-openapi v5.1.4
  • Loading branch information
sunli829 committed Nov 25, 2024
1 parent 97c65a8 commit d1d772c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 4 additions & 2 deletions poem-openapi-derive/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
});
Expand Down
6 changes: 6 additions & 0 deletions poem-openapi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion poem-openapi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 2 additions & 8 deletions poem-openapi/tests/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,15 @@ fn generics() {
delete_user: T2,
}

assert_eq!(
<Obj<i32, i64>>::name(),
"Obj_integer_int32_integer_int64"
);
assert_eq!(<Obj<i32, i64>>::name(), "Obj_integer_int32_integer_int64");
let meta = get_meta::<Obj<i32, i64>>();
assert_eq!(meta.properties[0].1.unwrap_inline().ty, "integer");
assert_eq!(meta.properties[0].1.unwrap_inline().format, Some("int32"));

assert_eq!(meta.properties[1].1.unwrap_inline().ty, "integer");
assert_eq!(meta.properties[1].1.unwrap_inline().format, Some("int64"));

assert_eq!(
<Obj<f32, f64>>::name(),
"Obj_number_float_number_double"
);
assert_eq!(<Obj<f32, f64>>::name(), "Obj_number_float_number_double");
let meta = get_meta::<Obj<f32, f64>>();
assert_eq!(meta.properties[0].1.unwrap_inline().ty, "number");
assert_eq!(meta.properties[0].1.unwrap_inline().format, Some("float"));
Expand Down
2 changes: 2 additions & 0 deletions poem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d1d772c

Please sign in to comment.