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
Hi, would be possible to add attribute security_scheme for generating swagger-ui security scheme without need to have it as a fn param? I have several APIs and it's little bit confusing to have _auth: SecuritySchema as parameter in almost all open api functions and only because of generating swagger api doc with lock icon next to the request definition.
Description of the feature
Hi, would be possible to add attribute security_scheme for generating swagger-ui security scheme without need to have it as a fn param? I have several APIs and it's little bit confusing to have _auth: SecuritySchema as parameter in almost all open api functions and only because of generating swagger api doc with lock icon next to the request definition.
Code example (if possible)
#[derive(SecurityScheme)]
#[oai(ty = "basic")]
pub struct BasicSecurityScheme(Basic);
It would be nice instead of this
#[OpenApi(
prefix_path = "/secure",
tag = "CustomApiTags::Custom",
)]
impl CustomApi {
#[oai(path = "/test-auth", method = "get")]
async fn test_auth(&self, _auth: SecurityScheme) -> Result {
Ok("Test auth".to_string())
}
}
use this
#[OpenApi(
prefix_path = "/secure",
tag = "CustomApiTags::Custom",
security_scheme = "BasicSecurityScheme"
)]
impl CustomApi {
#[oai(path = "/test", method = "get")]
async fn test(&self) -> Result {
Ok("Test auth".to_string())
}
}
or this
#[OpenApi(
prefix_path = "/secure",
tag = "CustomApiTags::Custom",
)]
impl CustomApi {
#[oai(path = "/test-auth", method = "get", security_scheme = "BasicSecurityScheme")]
async fn test_auth(&self) -> Result {
Ok("Test auth".to_string())
}
}
The text was updated successfully, but these errors were encountered: