chore(openapi): resolve openapi semantic inconsistency (#8099)

This commit is contained in:
Sakil Mostak
2025-05-22 15:21:54 +05:30
committed by GitHub
parent baf38c9ff6
commit fa4b552a32
9 changed files with 233 additions and 71 deletions

View File

@ -66,6 +66,9 @@ pub async fn retrieve_mandates_list() {}
#[utoipa::path(
post,
path = "/customers/{customer_id}/mandates",
params(
("customer_id" = String, Path, description = "The unique identifier for the customer")
),
responses(
(status = 200, description = "List of retrieved mandates for a customer", body = Vec<MandateResponse>),
(status = 400, description = "Invalid Data"),

View File

@ -5,6 +5,9 @@
#[utoipa::path(
post,
path = "/accounts/{account_id}/connectors",
params(
("account_id" = String, Path, description = "The unique identifier for the merchant account")
),
request_body(
content = MerchantConnectorCreate,
examples(

View File

@ -110,7 +110,7 @@ pub async fn list_customer_payment_method_api() {}
(status = 404, description = "Payment Methods does not exist in records")
),
tag = "Payment Methods",
operation_id = "List all Payment Methods for a Customer",
operation_id = "List Customer Payment Methods via Client Secret",
security(("publishable_key" = []))
)]
pub async fn list_customer_payment_method_api_client() {}
@ -181,7 +181,7 @@ pub async fn payment_method_delete_api() {}
///
/// Set the Payment Method as Default for the Customer.
#[utoipa::path(
get,
post,
path = "/{customer_id}/payment_methods/{payment_method_id}/default",
params (
("customer_id" = String,Path, description ="The unique identifier for the Customer"),
@ -375,7 +375,7 @@ pub fn payment_method_session_create() {}
#[cfg(feature = "v2")]
#[utoipa::path(
get,
path = "/v2/payment-method-session/:id",
path = "/v2/payment-method-session/{id}",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -396,7 +396,7 @@ pub fn payment_method_session_retrieve() {}
#[cfg(feature = "v2")]
#[utoipa::path(
get,
path = "/v2/payment-method-session/:id/list-payment-methods",
path = "/v2/payment-method-session/{id}/list-payment-methods",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -416,7 +416,7 @@ pub fn payment_method_session_list_payment_methods() {}
#[cfg(feature = "v2")]
#[utoipa::path(
put,
path = "/v2/payment-method-session/:id/update-saved-payment-method",
path = "/v2/payment-method-session/{id}/update-saved-payment-method",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -450,7 +450,7 @@ pub fn payment_method_session_update_saved_payment_method() {}
#[cfg(feature = "v2")]
#[utoipa::path(
delete,
path = "/v2/payment-method-session/:id",
path = "/v2/payment-method-session/{id}",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -507,7 +507,7 @@ pub async fn tokenize_card_api() {}
(status = 404, description = "Customer not found"),
),
tag = "Payment Methods",
operation_id = "Create card network token",
operation_id = "Create card network token using Payment Method ID",
security(("admin_api_key" = []))
)]
pub async fn tokenize_card_using_pm_api() {}
@ -517,7 +517,7 @@ pub async fn tokenize_card_using_pm_api() {}
/// **Confirms a payment method session object with the payment method data**
#[utoipa::path(
post,
path = "/v2/payment-method-session/:id/confirm",
path = "/v2/payment-method-session/{id}/confirm",
params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
(
"X-Profile-Id" = String, Header,

View File

@ -219,9 +219,12 @@ pub fn payments_create() {}
get,
path = "/payments/{payment_id}",
params(
("payment_id" = String, Path, description = "The identifier for payment")
("payment_id" = String, Path, description = "The identifier for payment"),
("force_sync" = Option<bool>, Query, description = "Decider to enable or disable the connector call for retrieve request"),
("client_secret" = Option<String>, Query, description = "This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK"),
("expand_attempts" = Option<bool>, Query, description = "If enabled provides list of attempts linked to payment intent"),
("expand_captures" = Option<bool>, Query, description = "If enabled provides list of captures linked to latest attempt"),
),
request_body=PaymentRetrieveBody,
responses(
(status = 200, description = "Gets the payment with final status", body = PaymentsResponse),
(status = 404, description = "No payment found")
@ -415,7 +418,7 @@ pub fn payments_connector_session() {}
(status = 400, description = "Missing mandatory fields")
),
tag = "Payments",
operation_id = "Create Session tokens for a Payment",
operation_id = "Create V2 Session tokens for a Payment",
security(("publishable_key" = []))
)]
pub fn payments_connector_session() {}
@ -462,15 +465,15 @@ pub fn payments_cancel() {}
get,
path = "/payments/list",
params(
("customer_id" = String, Query, description = "The identifier for the customer"),
("starting_after" = String, Query, description = "A cursor for use in pagination, fetch the next list after some object"),
("ending_before" = String, Query, description = "A cursor for use in pagination, fetch the previous list before some object"),
("limit" = i64, Query, description = "Limit on the number of objects to return"),
("created" = PrimitiveDateTime, Query, description = "The time at which payment is created"),
("created_lt" = PrimitiveDateTime, Query, description = "Time less than the payment created time"),
("created_gt" = PrimitiveDateTime, Query, description = "Time greater than the payment created time"),
("created_lte" = PrimitiveDateTime, Query, description = "Time less than or equals to the payment created time"),
("created_gte" = PrimitiveDateTime, Query, description = "Time greater than or equals to the payment created time")
("customer_id" = Option<String>, Query, description = "The identifier for the customer"),
("starting_after" = Option<String>, Query, description = "A cursor for use in pagination, fetch the next list after some object"),
("ending_before" = Option<String>, Query, description = "A cursor for use in pagination, fetch the previous list before some object"),
("limit" = Option<i64>, Query, description = "Limit on the number of objects to return"),
("created" = Option<PrimitiveDateTime>, Query, description = "The time at which payment is created"),
("created_lt" = Option<PrimitiveDateTime>, Query, description = "Time less than the payment created time"),
("created_gt" = Option<PrimitiveDateTime>, Query, description = "Time greater than the payment created time"),
("created_lte" = Option<PrimitiveDateTime>, Query, description = "Time less than or equals to the payment created time"),
("created_gte" = Option<PrimitiveDateTime>, Query, description = "Time greater than or equals to the payment created time")
),
responses(
(status = 200, description = "Successfully retrieved a payment list", body = Vec<PaymentListResponse>),
@ -587,6 +590,9 @@ pub fn payments_dynamic_tax_calculation() {}
#[utoipa::path(
post,
path = "/payments/{payment_id}/post_session_tokens",
params(
("payment_id" = String, Path, description = "The identifier for payment")
),
request_body=PaymentsPostSessionTokensRequest,
responses(
(status = 200, description = "Post Session Token is done", body = PaymentsPostSessionTokensResponse),
@ -603,6 +609,9 @@ pub fn payments_post_session_tokens() {}
#[utoipa::path(
post,
path = "/payments/{payment_id}/update_metadata",
params(
("payment_id" = String, Path, description = "The identifier for payment")
),
request_body=PaymentsUpdateMetadataRequest,
responses(
(status = 200, description = "Metadata updated successfully", body = PaymentsUpdateMetadataResponse),

View File

@ -368,7 +368,7 @@ pub async fn routing_retrieve_default_config() {}
(status = 401, description = "Unauthorized request")
),
tag = "Business Profile",
operation_id = "List all Merchant Connectors",
operation_id = "List all Merchant Connectors for Profile",
security(("admin_api_key" = []))
)]
#[cfg(feature = "v2")]

View File

@ -43,14 +43,11 @@ pub async fn relay() {}
#[utoipa::path(
get,
path = "/relay/{relay_id}",
params (("id" = String, Path, description = "The unique identifier for the Relay")),
params (("relay_id" = String, Path, description = "The unique identifier for the Relay"), ("X-Profile-Id" = String, Header, description = "Profile ID for authentication")),
responses(
(status = 200, description = "Relay Retrieved", body = RelayResponse),
(status = 404, description = "Relay details was not found")
),
params(
("X-Profile-Id" = String, Header, description = "Profile ID for authentication")
),
tag = "Relay",
operation_id = "Retrieve a Relay details",
security(("api_key" = []), ("ephemeral_key" = []))