From 4dd1d7c76cb26a30496ff03ffcae4e9005a55393 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Wed, 27 Sep 2023 15:10:36 +0800 Subject: [PATCH] Add comment document --- examples/oapi-generics/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/oapi-generics/src/main.rs b/examples/oapi-generics/src/main.rs index 0b0a43a0f..75f52a6c6 100644 --- a/examples/oapi-generics/src/main.rs +++ b/examples/oapi-generics/src/main.rs @@ -7,14 +7,19 @@ struct MyObject { value: T, } +/// Use string type, this will add to openapi doc. #[endpoint] async fn use_string(body: JsonBody>) -> String { format!("{:?}", body) } + +/// Use i32 type, this will add to openapi doc. #[endpoint] async fn use_i32(body: JsonBody>) -> String { format!("{:?}", body) } + +/// Use u64 type, this will add to openapi doc. #[endpoint] async fn use_u64(body: JsonBody>) -> String { format!("{:?}", body)