Skip to content

Commit

Permalink
docs(openapi): Fixed API documentation for V2
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuthaDev committed Nov 6, 2024
1 parent 01c5216 commit 01f8cc2
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/api_keys/{key_id}
openapi: get /v2/api_keys/{id}
---
2 changes: 1 addition & 1 deletion api-reference-v2/api-reference/api-key/api-key--revoke.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: delete /v2/api_keys/{key_id}
openapi: delete /v2/api_keys/{id}
---
2 changes: 1 addition & 1 deletion api-reference-v2/api-reference/api-key/api-key--update.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: put /v2/api_keys/{key_id}
openapi: put /v2/api_keys/{id}
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/merchant_accounts/{account_id}/profiles
openapi: get /v2/merchant_accounts/{id}/profiles
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: post /v2/payments/{payment_id}/create_external_sdk_tokens
openapi: post /v2/payments/{payment_id}/create-external-sdk-tokens
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/profiles/{profile_id}/connector_accounts
openapi: get /v2/profiles/{id}/connector_accounts
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: patch /v2/profiles/{profile_id}/activate_routing_algorithm
openapi: patch /v2/profiles/{id}/activate_routing_algorithm
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: patch /v2/profiles/{profile_id}/deactivate_routing_algorithm
openapi: patch /v2/profiles/{id}/deactivate_routing_algorithm
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/profiles/{profile_id}/routing_algorithm
openapi: get /v2/profiles/{id}/routing_algorithm
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/profiles/{profile_id}/fallback_routing
openapi: get /v2/profiles/{id}/fallback_routing
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/profiles/{profile_id}
openapi: get /v2/profiles/{id}
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: patch /v2/profiles/{profile_id}/fallback_routing
openapi: patch /v2/profiles/{id}/fallback_routing
---
2 changes: 1 addition & 1 deletion api-reference-v2/api-reference/profile/profile--update.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: put /v2/profiles/{profile_id}
openapi: put /v2/profiles/{id}
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
openapi: get /v2/routing_algorithm/{routing_algorithm_id}
openapi: get /v2/routing_algorithm/{id}
---
2 changes: 1 addition & 1 deletion api-reference-v2/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
]
},
{
"group": "Merchant Connector Account",
"group": "Connector Account",
"pages": [
"api-reference/merchant-connector-account/merchant-connector--create",
"api-reference/merchant-connector-account/merchant-connector--retrieve",
Expand Down
63 changes: 37 additions & 26 deletions api-reference-v2/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
"operationId": "Update a Merchant Account",
"parameters": [
{
"name": "account_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the merchant account",
"required": true,
Expand Down Expand Up @@ -630,17 +630,17 @@
]
}
},
"/v2/merchant_accounts/{account_id}/profiles": {
"/v2/merchant_accounts/{id}/profiles": {
"get": {
"tags": [
"Merchant Account"
],
"summary": "Profile - List",
"summary": "Merchant Account - Profile List",
"description": "List profiles for an Merchant",
"operationId": "List Profiles",
"parameters": [
{
"name": "account_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the Merchant",
"required": true,
Expand Down Expand Up @@ -682,6 +682,17 @@
"summary": "Payments - Session token",
"description": "Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Hyperswitch's SDK to initiate these wallets' SDK.",
"operationId": "Create Session tokens for a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
Expand Down Expand Up @@ -775,7 +786,7 @@
]
}
},
"/v2/profiles/{profile_id}": {
"/v2/profiles/{id}": {
"get": {
"tags": [
"Profile"
Expand All @@ -785,7 +796,7 @@
"operationId": "Retrieve a Profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -836,7 +847,7 @@
"operationId": "Update a Profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -896,17 +907,17 @@
]
}
},
"/v2/profiles/{profile_id}/connector_accounts": {
"/v2/profiles/{id}/connector_accounts": {
"get": {
"tags": [
"Business Profile"
],
"summary": "Merchant Connector - List",
"description": "List Merchant Connector Details for the business profile",
"summary": "Profile - Connector Accounts List",
"description": "List Connector Accounts for the profile",
"operationId": "List all Merchant Connectors",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the business profile",
"required": true,
Expand Down Expand Up @@ -955,7 +966,7 @@
]
}
},
"/v2/profiles/{profile_id}/activate_routing_algorithm": {
"/v2/profiles/{id}/activate_routing_algorithm": {
"patch": {
"tags": [
"Profile"
Expand All @@ -965,7 +976,7 @@
"operationId": "Activates a routing algorithm under a profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -1022,7 +1033,7 @@
]
}
},
"/v2/profiles/{profile_id}/deactivate_routing_algorithm": {
"/v2/profiles/{id}/deactivate_routing_algorithm": {
"patch": {
"tags": [
"Profile"
Expand All @@ -1032,7 +1043,7 @@
"operationId": " Deactivates a routing algorithm under a profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -1075,7 +1086,7 @@
]
}
},
"/v2/profiles/{profile_id}/fallback_routing": {
"/v2/profiles/{id}/fallback_routing": {
"patch": {
"tags": [
"Profile"
Expand All @@ -1085,7 +1096,7 @@
"operationId": "Update the default fallback routing algorithm for the profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -1149,7 +1160,7 @@
"operationId": "Retrieve the default fallback routing algorithm for the profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -1186,7 +1197,7 @@
]
}
},
"/v2/profiles/{profile_id}/routing_algorithm": {
"/v2/profiles/{id}/routing_algorithm": {
"get": {
"tags": [
"Profile"
Expand All @@ -1196,7 +1207,7 @@
"operationId": "Retrieve the active routing algorithm under the profile",
"parameters": [
{
"name": "profile_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the profile",
"required": true,
Expand Down Expand Up @@ -1315,7 +1326,7 @@
]
}
},
"/v2/routing_algorithm/{routing_algorithm_id}": {
"/v2/routing_algorithm/{id}": {
"get": {
"tags": [
"Routing"
Expand All @@ -1325,7 +1336,7 @@
"operationId": "Retrieve a routing algorithm with its algorithm id",
"parameters": [
{
"name": "routing_algorithm_id",
"name": "id",
"in": "path",
"description": "The unique identifier for a routing algorithm",
"required": true,
Expand Down Expand Up @@ -1405,7 +1416,7 @@
]
}
},
"/v2/api_keys/{key_id}": {
"/v2/api_keys/{id}": {
"get": {
"tags": [
"API Key"
Expand All @@ -1415,7 +1426,7 @@
"operationId": "Retrieve an API Key",
"parameters": [
{
"name": "key_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the API Key",
"required": true,
Expand Down Expand Up @@ -1454,7 +1465,7 @@
"operationId": "Update an API Key",
"parameters": [
{
"name": "key_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the API Key",
"required": true,
Expand Down Expand Up @@ -1503,7 +1514,7 @@
"operationId": "Revoke an API Key",
"parameters": [
{
"name": "key_id",
"name": "id",
"in": "path",
"description": "The unique identifier for the API Key",
"required": true,
Expand Down
12 changes: 6 additions & 6 deletions crates/openapi/src/routes/api_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ pub async fn api_key_retrieve() {}
/// Retrieve information about the specified API Key.
#[utoipa::path(
get,
path = "/v2/api_keys/{key_id}",
path = "/v2/api_keys/{id}",
params (
("key_id" = String, Path, description = "The unique identifier for the API Key")
("id" = String, Path, description = "The unique identifier for the API Key")
),
responses(
(status = 200, description = "API Key retrieved", body = RetrieveApiKeyResponse),
Expand Down Expand Up @@ -106,10 +106,10 @@ pub async fn api_key_update() {}
/// Update information for the specified API Key.
#[utoipa::path(
put,
path = "/v2/api_keys/{key_id}",
path = "/v2/api_keys/{id}",
request_body = UpdateApiKeyRequest,
params (
("key_id" = String, Path, description = "The unique identifier for the API Key")
("id" = String, Path, description = "The unique identifier for the API Key")
),
responses(
(status = 200, description = "API Key updated", body = RetrieveApiKeyResponse),
Expand Down Expand Up @@ -150,9 +150,9 @@ pub async fn api_key_revoke() {}
/// authenticating with our APIs.
#[utoipa::path(
delete,
path = "/v2/api_keys/{key_id}",
path = "/v2/api_keys/{id}",
params (
("key_id" = String, Path, description = "The unique identifier for the API Key")
("id" = String, Path, description = "The unique identifier for the API Key")
),
responses(
(status = 200, description = "API Key revoked", body = RevokeApiKeyResponse),
Expand Down
8 changes: 4 additions & 4 deletions crates/openapi/src/routes/merchant_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub async fn update_merchant_account() {}
)
),
)),
params (("account_id" = String, Path, description = "The unique identifier for the merchant account")),
params (("id" = String, Path, description = "The unique identifier for the merchant account")),
responses(
(status = 200, description = "Merchant Account Updated", body = MerchantAccountResponse),
(status = 404, description = "Merchant account not found")
Expand Down Expand Up @@ -295,13 +295,13 @@ pub async fn merchant_account_kv_status() {}
pub async fn payment_connector_list_profile() {}

#[cfg(feature = "v2")]
/// Profile - List
/// Merchant Account - Profile List
///
/// List profiles for an Merchant
#[utoipa::path(
get,
path = "/v2/merchant_accounts/{account_id}/profiles",
params (("account_id" = String, Path, description = "The unique identifier for the Merchant")),
path = "/v2/merchant_accounts/{id}/profiles",
params (("id" = String, Path, description = "The unique identifier for the Merchant")),
responses(
(status = 200, description = "profile list retrieved successfully", body = Vec<ProfileResponse>),
(status = 400, description = "Invalid data")
Expand Down
3 changes: 3 additions & 0 deletions crates/openapi/src/routes/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ pub fn payments_connector_session() {}
#[utoipa::path(
post,
path = "/v2/payments/{payment_id}/create-external-sdk-tokens",
params(
("payment_id" = String, Path, description = "The identifier for payment")
),
request_body=PaymentsSessionRequest,
responses(
(status = 200, description = "Payment session object created or session token was retrieved from wallets", body = PaymentsSessionResponse),
Expand Down
Loading

0 comments on commit 01f8cc2

Please sign in to comment.