Repository: netwo-io/apistos (rust)

Issue:
Incorrect Usage of ResponseWrapper Instead of ResponderWrapper
In the provided code snippet, there appears to be a typo in the usage of the type ResponseWrapper. It seems that ResponseWrapper should actually be ResponderWrapper according to the context.

Here's the corrected snippet:
```rs
if string_type == "impl Responder" {
    is_responder = true;

    *_type = Box::new(
        match syn::parse2(quote!(
            impl std::future::Future<Output=apistos::actix::ResponderWrapper<#_type>>
        )) {
            Ok(parsed) => parsed,
            Err(e) => abort!("parsing impl trait: {:?}", e),
        },
    );
}
```
https://github.com/netwo-io/apistos/blob/main/apistos-gen/src/internal/mod.rs#L153

Pull request:
Fix api_operation for impl Responder
Fixes #70 

Patch:
diff --git a/apistos-gen/src/internal/mod.rs b/apistos-gen/src/internal/mod.rs
index 354bbd7..965680c 100644
--- a/apistos-gen/src/internal/mod.rs
+++ b/apistos-gen/src/internal/mod.rs
@@ -150,7 +150,7 @@ pub(crate) fn gen_item_ast(
 
           *_type = Box::new(
             match syn::parse2(quote!(
-              impl std::future::Future<Output=apistos::actix::ResponseWrapper<#_type>>
+              impl std::future::Future<Output=apistos::actix::ResponderWrapper<#_type>>
             )) {
               Ok(parsed) => parsed,
               Err(e) => abort!("parsing impl trait: {:?}", e),
@@ -186,7 +186,7 @@ pub(crate) fn gen_item_ast(
 
   let block = item_ast.block;
   let inner_handler = if is_responder {
-    quote!(core::future::ready::ready(apistos::actix::ResponseWrapper((move || #block)())))
+    quote!(core::future::ready(apistos::actix::ResponderWrapper((move || #block)())))
   } else if is_impl_trait {
     quote!((move || #block)())
   } else {


Test patch:
diff --git a/apistos-gen-test/src/tests/api_operation.rs b/apistos-gen-test/src/tests/api_operation.rs
index 1b80457..bae4190 100644
--- a/apistos-gen-test/src/tests/api_operation.rs
+++ b/apistos-gen-test/src/tests/api_operation.rs
@@ -1,26 +1,29 @@
 use actix_multipart::form::MultipartForm;
 use actix_web::http::header::ContentType;
 use actix_web::web::Json;
-use actix_web::HttpResponse;
-use apistos::actix::{AcceptedJson, CreatedJson, NoContent};
-use apistos_core::PathItemDefinition;
-use apistos_gen::api_operation;
+use actix_web::{HttpResponse, Responder};
 use assert_json_diff::assert_json_eq;
 use schemars::_serde_json::json;
 use uuid::Uuid;
 
+use apistos::actix::{AcceptedJson, CreatedJson, NoContent};
+use apistos_core::PathItemDefinition;
+use apistos_gen::api_operation;
+
 #[allow(clippy::todo)]
 mod test_models {
+  use std::fmt::{Display, Formatter};
+  use std::future::Ready;
+
   use actix_multipart::form::{Limits, MultipartCollect, State};
   use actix_multipart::{Field, MultipartError};
   use actix_web::dev::Payload;
   use actix_web::http::StatusCode;
   use actix_web::{Error, FromRequest, HttpRequest, ResponseError};
-  use apistos_gen::{ApiComponent, ApiErrorComponent, ApiSecurity};
   use schemars::JsonSchema;
   use serde::{Deserialize, Serialize};
-  use std::fmt::{Display, Formatter};
-  use std::future::Ready;
+
+  use apistos_gen::{ApiComponent, ApiErrorComponent, ApiSecurity};
 
   #[derive(Serialize, Deserialize, Debug, Clone, JsonSchema, ApiComponent)]
   pub(crate) struct Test {
@@ -200,6 +203,70 @@ fn api_operation() {
   );
 }
 
+#[test]
+#[allow(dead_code)]
+fn api_operation_impl_responder() {
+  /// Add a new pet to the store
+  /// Add a new pet to the store
+  /// Plop
+  #[api_operation(tag = "pet")]
+  pub(crate) async fn test(_body: Json<test_models::Test>) -> impl Responder {
+    HttpResponse::Ok()
+  }
+
+  let components = __openapi_test::components();
+  // only one component here because: error does not have schema and Test is used both for query and response
+  assert_eq!(components.len(), 1);
+  let components = serde_json::to_value(components).expect("Unable to serialize as Json");
+
+  let operation = __openapi_test::operation();
+  let operation = serde_json::to_value(operation).expect("Unable to serialize as Json");
+
+  assert_json_eq!(
+    components,
+    json!([
+      {
+        "schemas": {
+          "Test": {
+            "properties": {
+              "test": {
+                "type": "string"
+              }
+            },
+            "required": [
+              "test"
+            ],
+            "title": "Test",
+            "type": "object"
+          }
+        }
+      }
+    ])
+  );
+  assert_json_eq!(
+    operation,
+    json!({
+      "deprecated": false,
+      "description": "Add a new pet to the store\\\nPlop",
+      "requestBody": {
+        "content": {
+          "application/json": {
+            "schema": {
+              "$ref": "#/components/schemas/Test"
+            }
+          }
+        },
+        "required": true
+      },
+      "responses": {},
+      "summary": "Add a new pet to the store",
+      "tags": [
+        "pet"
+      ]
+    })
+  );
+}
+
 #[test]
 #[allow(dead_code)]
 fn api_operation_simple_response() {