fix(router): Make v2 endpoints follow standard naming conventions (#8630)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Anurag Thakur
2025-07-21 19:33:25 +05:30
committed by GitHub
parent 2bac3e0a65
commit db14764671
24 changed files with 128 additions and 56 deletions

View File

@ -77,7 +77,7 @@ pub async fn organization_update() {}
/// Create a new organization
#[utoipa::path(
post,
path = "/v2/organization",
path = "/v2/organizations",
request_body(
content = OrganizationCreateRequest,
examples(
@ -104,7 +104,7 @@ pub async fn organization_create() {}
/// Retrieve an existing organization
#[utoipa::path(
get,
path = "/v2/organization/{id}",
path = "/v2/organizations/{id}",
params (("id" = String, Path, description = "The unique identifier for the Organization")),
responses(
(status = 200, description = "Organization Created", body =OrganizationResponse),
@ -122,7 +122,7 @@ pub async fn organization_retrieve() {}
/// Create a new organization for .
#[utoipa::path(
put,
path = "/v2/organization/{id}",
path = "/v2/organizations/{id}",
request_body(
content = OrganizationUpdateRequest,
examples(
@ -150,7 +150,7 @@ pub async fn organization_update() {}
/// List merchant accounts for an Organization
#[utoipa::path(
get,
path = "/v2/organization/{id}/merchant-accounts",
path = "/v2/organizations/{id}/merchant-accounts",
params (("id" = String, Path, description = "The unique identifier for the Organization")),
responses(
(status = 200, description = "Merchant Account list retrieved successfully", body = Vec<MerchantAccountResponse>),

View File

@ -353,7 +353,7 @@ pub async fn list_customer_payment_method_api() {}
#[cfg(feature = "v2")]
#[utoipa::path(
post,
path = "/v2/payment-method-session",
path = "/v2/payment-method-sessions",
request_body(
content = PaymentMethodSessionRequest,
examples (( "Create a payment method session with customer_id" = (
@ -378,7 +378,7 @@ pub fn payment_method_session_create() {}
#[cfg(feature = "v2")]
#[utoipa::path(
get,
path = "/v2/payment-method-session/{id}",
path = "/v2/payment-method-sessions/{id}",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -399,7 +399,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-sessions/{id}/list-payment-methods",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -419,7 +419,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-sessions/{id}/update-saved-payment-method",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -453,7 +453,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-sessions/{id}",
params (
("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
),
@ -520,7 +520,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-sessions/{id}/confirm",
params (("id" = String, Path, description = "The unique identifier for the Payment Method Session"),
(
"X-Profile-Id" = String, Header,

View File

@ -221,7 +221,7 @@ pub async fn refunds_create() {}
/// Updates the properties of a Refund object. This API can be used to attach a reason for the refund or metadata fields
#[utoipa::path(
put,
path = "/v2/refunds/{id}/update_metadata",
path = "/v2/refunds/{id}/update-metadata",
params(
("id" = String, Path, description = "The identifier for refund")
),

View File

@ -4,7 +4,7 @@
/// Retrieve the Revenue Recovery Payment Info
#[utoipa::path(
get,
path = "/v2/process_tracker/revenue_recovery_workflow/{revenue_recovery_id}",
path = "/v2/process-trackers/revenue-recovery-workflow/{revenue_recovery_id}",
params(
("recovery_recovery_id" = String, Path, description = "The payment intent id"),
),

View File

@ -26,7 +26,7 @@ pub async fn routing_create_config() {}
/// Create a routing algorithm
#[utoipa::path(
post,
path = "/v2/routing-algorithm",
path = "/v2/routing-algorithms",
request_body = RoutingConfigRequest,
responses(
(status = 200, description = "Routing Algorithm created", body = RoutingDictionaryRecord),
@ -92,7 +92,7 @@ pub async fn routing_retrieve_config() {}
/// Retrieve a routing algorithm with its algorithm id
#[utoipa::path(
get,
path = "/v2/routing-algorithm/{id}",
path = "/v2/routing-algorithms/{id}",
params(
("id" = String, Path, description = "The unique identifier for a routing algorithm"),
),