Skip to content

Commit

Permalink
refactor(openapi): update routing docs in openapi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
vspecky committed Dec 11, 2023
1 parent 2efd0a9 commit b27cf40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ pub struct PaymentsRequest {
// Makes the field mandatory in PaymentsCreateRequest
pub amount: Option<Amount>,

#[schema(value_type = Option<RoutingAlgorithm>, example = json!({
#[schema(value_type = Option<StraightThroughAlgorithm>, example = json!({
"type": "single",
"data": "stripe"
"data": [{"connector": "stripe", "merchant_connector_id": "mca_123"}]
}))]
pub routing: Option<serde_json::Value>,

Expand Down
1 change: 1 addition & 0 deletions crates/api_models/src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ pub enum RoutableChoiceSerde {
#[cfg_attr(not(feature = "connector_choice_bcompat"), derive(PartialEq, Eq))]
pub struct RoutableConnectorChoice {
#[cfg(feature = "connector_choice_bcompat")]
#[serde(skip)]
pub choice_kind: RoutableChoiceKind,
pub connector: RoutableConnectors,
#[cfg(feature = "connector_choice_mca_id")]
Expand Down
1 change: 1 addition & 0 deletions crates/euclid/src/frontend/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ pub struct Program<O> {
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct RoutableConnectorChoice {
#[cfg(feature = "connector_choice_bcompat")]
#[serde(skip)]
pub choice_kind: RoutableChoiceKind,
// pub connector: RoutableConnectors,
#[cfg(feature = "connector_choice_mca_id")]
Expand Down
18 changes: 11 additions & 7 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -8609,6 +8609,7 @@
"type": "object",
"required": [
"id",
"profile_id",
"name",
"description",
"algorithm",
Expand All @@ -8619,6 +8620,9 @@
"id": {
"type": "string"
},
"profile_id": {
"type": "string"
},
"name": {
"type": "string"
},
Expand Down Expand Up @@ -10307,7 +10311,7 @@
"routing": {
"allOf": [
{
"$ref": "#/components/schemas/RoutingAlgorithm"
"$ref": "#/components/schemas/StraightThroughAlgorithm"
}
],
"nullable": true
Expand Down Expand Up @@ -10677,7 +10681,7 @@
"routing": {
"allOf": [
{
"$ref": "#/components/schemas/RoutingAlgorithm"
"$ref": "#/components/schemas/StraightThroughAlgorithm"
}
],
"nullable": true
Expand Down Expand Up @@ -12763,17 +12767,13 @@
"RoutableConnectorChoice": {
"type": "object",
"required": [
"choice_kind",
"connector"
],
"properties": {
"choice_kind": {
"$ref": "#/components/schemas/RoutableChoiceKind"
},
"connector": {
"$ref": "#/components/schemas/RoutableConnectors"
},
"sub_label": {
"merchant_connector_id": {
"type": "string",
"nullable": true
}
Expand Down Expand Up @@ -12985,6 +12985,7 @@
"type": "object",
"required": [
"id",
"profile_id",
"name",
"kind",
"description",
Expand All @@ -12995,6 +12996,9 @@
"id": {
"type": "string"
},
"profile_id": {
"type": "string"
},
"name": {
"type": "string"
},
Expand Down

0 comments on commit b27cf40

Please sign in to comment.