docs(openapi): document security schemes (#676)

Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Sanchith Hegde
2023-03-01 11:46:50 +05:30
committed by GitHub
parent 4f4b9d7f5f
commit c5fda7ac68
12 changed files with 419 additions and 86 deletions

View File

@ -21,7 +21,8 @@ use crate::{
(status = 400, description = "Invalid data")
),
tag = "Merchant Account",
operation_id = "Create a Merchant Account"
operation_id = "Create a Merchant Account",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::MerchantsAccountCreate))]
pub async fn merchant_account_create(
@ -52,7 +53,8 @@ pub async fn merchant_account_create(
(status = 404, description = "Merchant account not found")
),
tag = "Merchant Account",
operation_id = "Retrieve a Merchant Account"
operation_id = "Retrieve a Merchant Account",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::MerchantsAccountRetrieve))]
pub async fn retrieve_merchant_account(
@ -88,7 +90,8 @@ pub async fn retrieve_merchant_account(
(status = 404, description = "Merchant account not found")
),
tag = "Merchant Account",
operation_id = "Update a Merchant Account"
operation_id = "Update a Merchant Account",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::MerchantsAccountUpdate))]
pub async fn update_merchant_account(
@ -121,7 +124,8 @@ pub async fn update_merchant_account(
(status = 404, description = "Merchant account not found")
),
tag = "Merchant Account",
operation_id = "Delete a Merchant Account"
operation_id = "Delete a Merchant Account",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::MerchantsAccountDelete))]
// #[delete("/{id}")]
@ -157,7 +161,8 @@ pub async fn delete_merchant_account(
(status = 400, description = "Missing Mandatory fields"),
),
tag = "Merchant Connector Account",
operation_id = "Create a Merchant Connector"
operation_id = "Create a Merchant Connector",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::PaymentConnectorsCreate))]
pub async fn payment_connector_create(
@ -194,7 +199,8 @@ pub async fn payment_connector_create(
(status = 401, description = "Unauthorized request")
),
tag = "Merchant Connector Account",
operation_id = "Retrieve a Merchant Connector"
operation_id = "Retrieve a Merchant Connector",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::PaymentConnectorsRetrieve))]
pub async fn payment_connector_retrieve(
@ -236,7 +242,8 @@ pub async fn payment_connector_retrieve(
(status = 401, description = "Unauthorized request")
),
tag = "Merchant Connector Account",
operation_id = "List all Merchant Connectors"
operation_id = "List all Merchant Connectors",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::PaymentConnectorsList))]
pub async fn payment_connector_list(
@ -273,7 +280,8 @@ pub async fn payment_connector_list(
(status = 401, description = "Unauthorized request")
),
tag = "Merchant Connector Account",
operation_id = "Update a Merchant Connector"
operation_id = "Update a Merchant Connector",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::PaymentConnectorsUpdate))]
pub async fn payment_connector_update(
@ -312,7 +320,8 @@ pub async fn payment_connector_update(
(status = 401, description = "Unauthorized request")
),
tag = "Merchant Connector Account",
operation_id = "Delete a Merchant Connector"
operation_id = "Delete a Merchant Connector",
security(("admin_api_key" = []))
)]
#[instrument(skip_all, fields(flow = ?Flow::PaymentConnectorsDelete))]
pub async fn payment_connector_delete(