Repository: netwo-io/apistos (rust)

Issue:
New update is not compatible with macro mode of actix_web_grants
First of all thank you for quick fix about last feature request. It solved my biggest issues. This issue is not critical but would-be-nice type of issue. Error is: 

When I wrote like that api operation throws bunch of errors. 
```
#[actix_web_grants::protect("ADMIN")]
#[api_operation(
    tag = "test",
    summary = "test endpoint",
    skip_args = "identity"
)]
pub async fn test_fun(
```

Errors: 
```error[E0599]: no function or associated item named `parameters` found for struct `AuthDetails` in the current scope```


``` function or associated item not found in `ResponseWrapper<Box<dyn Future<Output = Either<Result<HttpResponse, Error>, HttpResponse>> + Unpin>, ...>` ```


```error[E0599]: no function or associated item named `required` found for struct `AuthDetails` in the current scope```


Pull request description:
Add support for actix-web-grants
Fixes #109 

Patch:
diff --git a/Cargo.toml b/Cargo.toml
index 6b2fb2c..817caff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,11 +22,12 @@ documentation = "https://docs.rs/apistos/"
 license = "MIT OR Apache-2.0"
 rust-version = "1.75"
 publish = true
-version = "0.3.1"
+version = "0.3.2"
 
 [workspace.dependencies]
 actix-service = "2"
 actix-web = "4"
+actix-web-grants = "4"
 actix-web-lab = "0.20"
 assert-json-diff = "2.0.2"
 convert_case = "0.6"
diff --git a/apistos-core/Cargo.toml b/apistos-core/Cargo.toml
index 694278a..3014e2a 100644
--- a/apistos-core/Cargo.toml
+++ b/apistos-core/Cargo.toml
@@ -19,6 +19,7 @@ schemars = { workspace = true }
 
 actix-web = { workspace = true, optional = true }
 actix-web-lab = { workspace = true, optional = true }
+actix-web-grants = { workspace = true, optional = true }
 actix-multipart = { workspace = true, optional = true }
 garde-actix-web = { workspace = true, optional = true }
 chrono = { workspace = true, optional = true }
@@ -28,7 +29,7 @@ serde_qs = { workspace = true, features = ["actix4"], optional = true }
 uuid = { workspace = true, optional = true }
 url = { workspace = true, optional = true }
 
-apistos-models = { path = "../apistos-models", version = "0.3.1", features = ["deserialize"] }
+apistos-models = { path = "../apistos-models", version = "0.3.2", features = ["deserialize"] }
 
 [dev-dependencies]
 assert-json-diff = { workspace = true }
@@ -40,6 +41,7 @@ workspace = true
 
 [features]
 actix = ["dep:actix-web"]
+actix-web-grants = ["dep:actix-web-grants"]
 
 # query related features
 query = []
diff --git a/apistos-core/src/components/empty.rs b/apistos-core/src/components/empty.rs
index 8d56873..9a708fb 100644
--- a/apistos-core/src/components/empty.rs
+++ b/apistos-core/src/components/empty.rs
@@ -18,3 +18,16 @@ macro_rules! empty_component_impl {
 }
 
 empty_component_impl!(HttpRequest, HttpResponse, Payload, ());
+
+#[cfg(feature = "actix-web-grants")]
+impl<T> ApiComponent for actix_web_grants::authorities::AuthDetails<T>
+where
+  T: Eq + std::hash::Hash,
+{
+  fn child_schemas() -> Vec<(String, ReferenceOr<Schema>)> {
+    vec![]
+  }
+  fn schema() -> Option<(String, ReferenceOr<Schema>)> {
+    None
+  }
+}
diff --git a/apistos-rapidoc/Cargo.toml b/apistos-rapidoc/Cargo.toml
index 45c6728..7086ce7 100644
--- a/apistos-rapidoc/Cargo.toml
+++ b/apistos-rapidoc/Cargo.toml
@@ -14,7 +14,7 @@ rust-version.workspace = true
 license.workspace = true
 
 [dependencies]
-apistos-plugins = { path = "../apistos-plugins", version = "0.3.1" }
+apistos-plugins = { path = "../apistos-plugins", version = "0.3.2" }
 
 [lints]
 workspace = true
diff --git a/apistos-redoc/Cargo.toml b/apistos-redoc/Cargo.toml
index 0565300..5467678 100644
--- a/apistos-redoc/Cargo.toml
+++ b/apistos-redoc/Cargo.toml
@@ -14,7 +14,7 @@ rust-version.workspace = true
 license.workspace = true
 
 [dependencies]
-apistos-plugins = { path = "../apistos-plugins", version = "0.3.1" }
+apistos-plugins = { path = "../apistos-plugins", version = "0.3.2" }
 
 [lints]
 workspace = true
diff --git a/apistos-scalar/Cargo.toml b/apistos-scalar/Cargo.toml
index ee11ed4..ee9ea44 100644
--- a/apistos-scalar/Cargo.toml
+++ b/apistos-scalar/Cargo.toml
@@ -14,7 +14,7 @@ rust-version.workspace = true
 license.workspace = true
 
 [dependencies]
-apistos-plugins = { path = "../apistos-plugins", version = "0.3.1" }
+apistos-plugins = { path = "../apistos-plugins", version = "0.3.2" }
 
 [lints]
 workspace = true
diff --git a/apistos-shuttle/Cargo.toml b/apistos-shuttle/Cargo.toml
index ef3302e..a16fb24 100644
--- a/apistos-shuttle/Cargo.toml
+++ b/apistos-shuttle/Cargo.toml
@@ -18,7 +18,7 @@ actix-web = { workspace = true }
 num_cpus = { workspace = true }
 shuttle-runtime = { workspace = true }
 
-apistos = { path = "../apistos", version = "0.3.1" }
+apistos = { path = "../apistos", version = "0.3.2" }
 
 [lints]
 workspace = true
diff --git a/apistos-swagger-ui/Cargo.toml b/apistos-swagger-ui/Cargo.toml
index c195211..8724119 100644
--- a/apistos-swagger-ui/Cargo.toml
+++ b/apistos-swagger-ui/Cargo.toml
@@ -14,7 +14,7 @@ rust-version.workspace = true
 license.workspace = true
 
 [dependencies]
-apistos-plugins = { path = "../apistos-plugins", version = "0.3.1" }
+apistos-plugins = { path = "../apistos-plugins", version = "0.3.2" }
 
 [lints]
 workspace = true
diff --git a/apistos/Cargo.toml b/apistos/Cargo.toml
index a71d936..e6d663b 100644
--- a/apistos/Cargo.toml
+++ b/apistos/Cargo.toml
@@ -25,25 +25,25 @@ schemars = { workspace = true }
 serde = { workspace = true }
 serde_json = { workspace = true }
 
-apistos-core = { path = "../apistos-core", version = "0.3.1" }
-apistos-gen = { path = "../apistos-gen", version = "0.3.1" }
-apistos-models = { path = "../apistos-models", version = "0.3.1" }
-apistos-plugins = { path = "../apistos-plugins", version = "0.3.1" }
-apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.3.1", optional = true }
-apistos-redoc = { path = "../apistos-redoc", version = "0.3.1", optional = true }
-apistos-scalar = { path = "../apistos-scalar", version = "0.3.1", optional = true }
-apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.3.1", optional = true }
+apistos-core = { path = "../apistos-core", version = "0.3.2" }
+apistos-gen = { path = "../apistos-gen", version = "0.3.2" }
+apistos-models = { path = "../apistos-models", version = "0.3.2" }
+apistos-plugins = { path = "../apistos-plugins", version = "0.3.2" }
+apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.3.2", optional = true }
+apistos-redoc = { path = "../apistos-redoc", version = "0.3.2", optional = true }
+apistos-scalar = { path = "../apistos-scalar", version = "0.3.2", optional = true }
+apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.3.2", optional = true }
 
 
 [dev-dependencies]
 actix-web-lab = { workspace = true }
 garde-actix-web = { workspace = true }
 
-apistos-models = { path = "../apistos-models", version = "0.3.1", features = ["deserialize"] }
-apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.3.1" }
-apistos-redoc = { path = "../apistos-redoc", version = "0.3.1" }
-apistos-scalar = { path = "../apistos-scalar", version = "0.3.1" }
-apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.3.1" }
+apistos-models = { path = "../apistos-models", version = "0.3.2", features = ["deserialize"] }
+apistos-rapidoc = { path = "../apistos-rapidoc", version = "0.3.2" }
+apistos-redoc = { path = "../apistos-redoc", version = "0.3.2" }
+apistos-scalar = { path = "../apistos-scalar", version = "0.3.2" }
+apistos-swagger-ui = { path = "../apistos-swagger-ui", version = "0.3.2" }
 
 [lints]
 workspace = true


Test patch:
diff --git a/apistos-gen-test/Cargo.toml b/apistos-gen-test/Cargo.toml
index c5b5456..9e5713b 100644
--- a/apistos-gen-test/Cargo.toml
+++ b/apistos-gen-test/Cargo.toml
@@ -20,8 +20,8 @@ assert-json-diff = { workspace = true }
 chrono = { workspace = true, features = ["serde"] }
 futures-core = { workspace = true }
 apistos = { path = "../apistos", features = ["multipart", "uuid"] }
-apistos-core = { path = "../apistos-core", version = "0.3.1" }
-apistos-gen = { path = "../apistos-gen", version = "0.3.1" }
+apistos-core = { path = "../apistos-core", version = "0.3.2" }
+apistos-gen = { path = "../apistos-gen", version = "0.3.2" }
 # we use the "preserve_order" feature from schemars here following https://github.com/netwo-io/apistos/pull/78
 schemars = { workspace = true, features = ["preserve_order"] }
 serde = { version = "1.0.188", features = ["derive"] }