You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the test in poem/poem-openapi/tests/newtype.rs. The comment there all gets converted into a description. This is different to regular structs that derive Object, they use the first line for the summary. It would be cool if the first line of the struct was used as the param title.
Code example (if possible)
I would expect this test to pass:
#[tokio::test]
async fn new_type_summary_and_description() {
/// MyString
///
/// A
/// B
/// C
#[derive(NewType)]
struct MyString(String);
let schema = MyString::schema_ref();
let schema = schema.unwrap_inline();
assert_eq!(schema.title, Some("MyString"));
assert_eq!(schema.description, Some("A\nB\nC"));
}
I can look at adding this myself later.
The text was updated successfully, but these errors were encountered:
Description of the feature
See the test in
poem/poem-openapi/tests/newtype.rs
. The comment there all gets converted into a description. This is different to regular structs that deriveObject
, they use the first line for the summary. It would be cool if the first line of the struct was used as the param title.Code example (if possible)
I would expect this test to pass:
I can look at adding this myself later.
The text was updated successfully, but these errors were encountered: