Skip to content

Commit

Permalink
address pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ShankarSinghC committed Dec 20, 2024
1 parent 6c7414f commit e7db9e0
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 20 deletions.
32 changes: 23 additions & 9 deletions api-reference/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,26 @@
"summary": "Relay - Create",
"description": "Creates a relay request.",
"operationId": "Relay Request",
"parameters": [
{
"name": "X-Profile-Id",
"in": "header",
"description": "Profile ID for authentication",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "X-Idempotency-Key",
"in": "header",
"description": "Idempotency Key for relay request",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
Expand Down Expand Up @@ -1014,9 +1034,9 @@
"operationId": "Retrieve a Relay details",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier for the Relay",
"name": "X-Profile-Id",
"in": "header",
"description": "Profile ID for authentication",
"required": true,
"schema": {
"type": "string"
Expand Down Expand Up @@ -23048,7 +23068,6 @@
"required": [
"connector_resource_id",
"connector_id",
"profile_id",
"type"
],
"properties": {
Expand All @@ -23062,11 +23081,6 @@
"description": "Identifier of the connector ( merchant connector account ) to which relay request is being made",
"example": "mca_5apGeP94tMts6rg3U3kR"
},
"profile_id": {
"type": "string",
"description": "The business profile that is associated with this relay request",
"example": "pro_abcdefghijklmnopqrstuvwxyz"
},
"type": {
"$ref": "#/components/schemas/RelayType"
},
Expand Down
3 changes: 0 additions & 3 deletions crates/api_models/src/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ pub struct RelayRequest {
/// Identifier of the connector ( merchant connector account ) to which relay request is being made
#[schema(example = "mca_5apGeP94tMts6rg3U3kR", value_type = String)]
pub connector_id: common_utils::id_type::MerchantConnectorAccountId,
/// The business profile that is associated with this relay request
#[schema(example = "pro_abcdefghijklmnopqrstuvwxyz", value_type = String)]
pub profile_id: common_utils::id_type::ProfileId,
/// The type of relay request
#[serde(rename = "type")]
pub relay_type: RelayType,
Expand Down
22 changes: 14 additions & 8 deletions crates/openapi/src/routes/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#[utoipa::path(
post,
path = "/relay",
request_body (
request_body(
content = RelayRequest,
examples ((
"Create a relay request" = (
value = json!({
examples((
"Create a relay request" = (
value = json!({
"connector_resource_id": "7256228702616471803954",
"connector_id": "mca_5apGeP94tMts6rg3U3kR",
"profile_id": "pro_abcdefghijklmnopqrstuvwxyz",
Expand All @@ -17,14 +17,17 @@
"amount": 6540,
"currency": "USD"
}
})
)
))
})
)
))
),
responses(
(status = 200, description = "Relay request", body = RelayResponse),
(status = 400, description = "Invalid data")
),
params(
("X-Profile-Id" = String, Header, description = "Profile ID for authentication"),
("X-Idempotency-Key" = String, Header, description = "Idempotency Key for relay request")
),
tag = "Relay",
operation_id = "Relay Request",
Expand All @@ -44,6 +47,9 @@ pub async fn relay() {}
(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" = []))
Expand Down

0 comments on commit e7db9e0

Please sign in to comment.