Skip to content

Commit

Permalink
fix: open_api_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsMani committed Nov 16, 2023
1 parent 02ad25d commit f4f7c36
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
7 changes: 5 additions & 2 deletions crates/api_models/src/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ pub struct MerchantConnectorCreate {

pub pm_auth_config: Option<serde_json::Value>,

pub status: Option<common_enums::ConnectorStatus>,
#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: Option<api_enums::ConnectorStatus>,
}

#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
Expand Down Expand Up @@ -712,6 +713,7 @@ pub struct MerchantConnectorResponse {

pub pm_auth_config: Option<serde_json::Value>,

#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: api_enums::ConnectorStatus,
}

Expand Down Expand Up @@ -788,7 +790,8 @@ pub struct MerchantConnectorUpdate {

pub pm_auth_config: Option<serde_json::Value>,

pub status: Option<common_enums::ConnectorStatus>,
#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: Option<api_enums::ConnectorStatus>,
}

///Details of FrmConfigs are mentioned here... it should be passed in payment connector create api call, and stored in merchant_connector_table
Expand Down
10 changes: 5 additions & 5 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1858,18 +1858,18 @@ pub enum ApplePayFlow {
Clone,
Copy,
Debug,
Default,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
utoipa::ToSchema,
serde::Deserialize,
serde::Serialize,
ToSchema,
Default,
)]
#[router_derive::diesel_enum(storage_type = "pg_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
#[serde(rename_all = "snake_case")]
pub enum ConnectorStatus {
#[default]
Inactive,
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::enums::AttemptStatus,
api_models::enums::CaptureStatus,
api_models::enums::ReconStatus,
api_models::enums::ConnectorStatus,
api_models::admin::MerchantConnectorCreate,
api_models::admin::MerchantConnectorUpdate,
api_models::admin::PrimaryBusinessDetails,
Expand Down
29 changes: 14 additions & 15 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3973,6 +3973,13 @@
}
}
},
"ConnectorStatus": {
"type": "string",
"enum": [
"inactive",
"active"
]
},
"ConnectorType": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -6474,7 +6481,8 @@
"description": "Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.\"",
"required": [
"connector_type",
"connector_name"
"connector_name",
"status"
],
"properties": {
"connector_type": {
Expand Down Expand Up @@ -6607,12 +6615,7 @@
"nullable": true
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/common_enums.ConnectorStatus"
}
],
"nullable": true
"$ref": "#/components/schemas/ConnectorStatus"
}
}
},
Expand Down Expand Up @@ -6844,15 +6847,16 @@
"nullable": true
},
"status": {
"$ref": "#/components/schemas/api_enums.ConnectorStatus"
"$ref": "#/components/schemas/ConnectorStatus"
}
}
},
"MerchantConnectorUpdate": {
"type": "object",
"description": "Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc.\"",
"required": [
"connector_type"
"connector_type",
"status"
],
"properties": {
"connector_type": {
Expand Down Expand Up @@ -6952,12 +6956,7 @@
"nullable": true
},
"status": {
"allOf": [
{
"$ref": "#/components/schemas/common_enums.ConnectorStatus"
}
],
"nullable": true
"$ref": "#/components/schemas/ConnectorStatus"
}
}
},
Expand Down

0 comments on commit f4f7c36

Please sign in to comment.