Repository: netwo-io/apistos (rust)

Issue:
Add support for function without any argument for the api_operation macro
Currently if I want to use the api_operation macro the following way, there is no problem:
```rust
#[api_operation(summary = "Get an element from the todo list")]
pub(crate) async fn get_todo(todo_id: Path<Uuid>) -> Result<Json<Todo>, Error> {
    // because it is a sample app, we do not currently implement any logic to store todos
    Ok(Json(Todo {
        id: todo_id.into_inner(),
        title: "some title".to_string(),
        description: None,
    }))
}
```
But if I want to use it like that:
```rust
#[api_operation(summary = "Get an element from the todo list")]
pub(crate) async fn get_todo() -> Result<Json<Todo>, Error> {
    // because it is a sample app, we do not currently implement any logic to store todos
    Ok(Json(Todo {
        id: Uuid::new_v4(),
        title: "some title".to_string(),
        description: None,
    }))
}
```
I get a compilation error:
```
error[E0282]: type annotations needed
  --> src/api.rs:22:1
   |
22 | #[api_operation(summary = "Get an element from the todo list")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
   |
   = note: this error originates in the macro `vec` which comes from the expansion of the attribute macro `api_operation` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Pull request:
Fix #60 -> Add support for function without any argument for the api_…
Fix #60 

Patch:
diff --git a/apistos-gen/src/internal/operation.rs b/apistos-gen/src/internal/operation.rs
index 2ff48cc..8c5817e 100644
--- a/apistos-gen/src/internal/operation.rs
+++ b/apistos-gen/src/internal/operation.rs
@@ -99,7 +99,7 @@ impl<'a> ToTokens for Operation<'a> {
         use apistos::ApiComponent;
         let mut operation_builder = apistos::paths::Operation::default();
 
-        let mut body_requests = vec![];
+        let mut body_requests: Vec<std::option::Option<apistos::paths::RequestBody>> = vec![];
         #(
           let mut request_body = <#args>::request_body();
           let consumes: Option<String> = #consumes;


Test patch:
diff --git a/apistos-gen-test/src/tests/api_operation.rs b/apistos-gen-test/src/tests/api_operation.rs
index 1d48607..ae64d91 100644
--- a/apistos-gen-test/src/tests/api_operation.rs
+++ b/apistos-gen-test/src/tests/api_operation.rs
@@ -199,6 +199,76 @@ fn api_operation() {
   );
 }
 
+#[test]
+#[allow(dead_code)]
+fn api_operation_without_parameters() {
+  /// Add a new pet to the store
+  /// Add a new pet to the store
+  /// Plop
+  #[api_operation(tag = "pet")]
+  pub(crate) async fn test() -> Result<Json<test_models::TestResult>, test_models::ErrorResponse> {
+    Ok(Json(test_models::TestResult { id: 0 }))
+  }
+
+  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": {
+          "TestResult": {
+            "properties": {
+              "id": {
+                "format": "uint32",
+                "minimum": 0.0,
+                "type": "integer"
+              }
+            },
+            "required": [
+              "id"
+            ],
+            "title": "TestResult",
+            "type": "object"
+          }
+        }
+      }
+    ])
+  );
+  assert_json_eq!(
+    operation,
+    json!({
+      "deprecated": false,
+      "description": "Add a new pet to the store\\\nPlop",
+      "responses": {
+        "200": {
+          "content": {
+            "application/json": {
+              "schema": {
+                "$ref": "#/components/schemas/TestResult"
+              }
+            }
+          },
+          "description": ""
+        },
+        "405": {
+          "description": "Invalid input"
+        }
+      },
+      "summary": "Add a new pet to the store",
+      "tags": [
+        "pet"
+      ]
+    })
+  );
+}
+
 #[test]
 #[allow(dead_code)]
 fn api_operation_no_content() {