Skip to content

Commit b39bdbf

Browse files
fix(router): disable openapi examples (#2648)
1 parent 83f0062 commit b39bdbf

File tree

2 files changed

+49
-74
lines changed

2 files changed

+49
-74
lines changed

crates/router/src/routes/payments.rs

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ use crate::{
1313
payment_methods::{Oss, PaymentMethodRetrieve},
1414
payments::{self, PaymentRedirectFlow},
1515
},
16-
openapi::examples::{
17-
PAYMENTS_CREATE, PAYMENTS_CREATE_MINIMUM_FIELDS, PAYMENTS_CREATE_WITH_ADDRESS,
18-
PAYMENTS_CREATE_WITH_CUSTOMER_DATA, PAYMENTS_CREATE_WITH_FORCED_3DS,
19-
PAYMENTS_CREATE_WITH_MANUAL_CAPTURE, PAYMENTS_CREATE_WITH_NOON_ORDER_CATETORY,
20-
PAYMENTS_CREATE_WITH_ORDER_DETAILS,
21-
},
16+
// openapi::examples::{
17+
// PAYMENTS_CREATE, PAYMENTS_CREATE_MINIMUM_FIELDS, PAYMENTS_CREATE_WITH_ADDRESS,
18+
// PAYMENTS_CREATE_WITH_CUSTOMER_DATA, PAYMENTS_CREATE_WITH_FORCED_3DS,
19+
// PAYMENTS_CREATE_WITH_MANUAL_CAPTURE, PAYMENTS_CREATE_WITH_NOON_ORDER_CATETORY,
20+
// PAYMENTS_CREATE_WITH_ORDER_DETAILS,
21+
// },
2222
routes::lock_utils,
2323
services::{api, authentication as auth},
2424
types::{
@@ -36,48 +36,49 @@ use crate::{
3636
path = "/payments",
3737
request_body(
3838
content = PaymentsCreateRequest,
39-
examples(
40-
(
41-
"Create a payment with minimul fields" = (
42-
value = json!(PAYMENTS_CREATE_MINIMUM_FIELDS)
43-
)
44-
),
45-
(
46-
"Create a manual capture payment" = (
47-
value = json!(PAYMENTS_CREATE_WITH_MANUAL_CAPTURE)
48-
)
49-
),
50-
(
51-
"Create a payment with address" = (
52-
value = json!(PAYMENTS_CREATE_WITH_ADDRESS)
53-
)
54-
),
55-
(
56-
"Create a payment with customer details" = (
57-
value = json!(PAYMENTS_CREATE_WITH_CUSTOMER_DATA)
58-
)
59-
),
60-
(
61-
"Create a 3DS payment" = (
62-
value = json!(PAYMENTS_CREATE_WITH_FORCED_3DS)
63-
)
64-
),
65-
(
66-
"Create a payment" = (
67-
value = json!(PAYMENTS_CREATE)
68-
)
69-
),
70-
(
71-
"Create a payment with order details" = (
72-
value = json!(PAYMENTS_CREATE_WITH_ORDER_DETAILS)
73-
)
74-
),
75-
(
76-
"Create a payment with order category for noon" = (
77-
value = json!(PAYMENTS_CREATE_WITH_NOON_ORDER_CATETORY)
78-
)
79-
),
80-
)),
39+
// examples(
40+
// (
41+
// "Create a payment with minimul fields" = (
42+
// value = json!(PAYMENTS_CREATE_MINIMUM_FIELDS)
43+
// )
44+
// ),
45+
// (
46+
// "Create a manual capture payment" = (
47+
// value = json!(PAYMENTS_CREATE_WITH_MANUAL_CAPTURE)
48+
// )
49+
// ),
50+
// (
51+
// "Create a payment with address" = (
52+
// value = json!(PAYMENTS_CREATE_WITH_ADDRESS)
53+
// )
54+
// ),
55+
// (
56+
// "Create a payment with customer details" = (
57+
// value = json!(PAYMENTS_CREATE_WITH_CUSTOMER_DATA)
58+
// )
59+
// ),
60+
// (
61+
// "Create a 3DS payment" = (
62+
// value = json!(PAYMENTS_CREATE_WITH_FORCED_3DS)
63+
// )
64+
// ),
65+
// (
66+
// "Create a payment" = (
67+
// value = json!(PAYMENTS_CREATE)
68+
// )
69+
// ),
70+
// (
71+
// "Create a payment with order details" = (
72+
// value = json!(PAYMENTS_CREATE_WITH_ORDER_DETAILS)
73+
// )
74+
// ),
75+
// (
76+
// "Create a payment with order category for noon" = (
77+
// value = json!(PAYMENTS_CREATE_WITH_NOON_ORDER_CATETORY)
78+
// )
79+
// ),
80+
// )
81+
),
8182
responses(
8283
(status = 200, description = "Payment created", body = PaymentsResponse),
8384
(status = 400, description = "Missing Mandatory fields")

openapi/openapi_spec.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,32 +1063,6 @@
10631063
"application/json": {
10641064
"schema": {
10651065
"$ref": "#/components/schemas/PaymentsCreateRequest"
1066-
},
1067-
"examples": {
1068-
"Create a 3DS payment": {
1069-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"authentication_type\" : \"three_ds\"\n }"
1070-
},
1071-
"Create a manual capture payment": {
1072-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"capture_method\":\"manual\"\n }"
1073-
},
1074-
"Create a payment": {
1075-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"payment_id\": \"abcdefghijklmnopqrstuvwxyz\",\n \"customer\": {\n \"id\":\"cus_abcdefgh\",\n \"name\":\"John Dough\",\n \"phone\":\"9999999999\",\n \"email\":\"[email protected]\"\n },\n \"description\": \"Its my first payment request\",\n \"statement_descriptor_name\": \"joseph\",\n \"statement_descriptor_suffix\": \"JS\",\n \"metadata\": {\n \"udf1\": \"some-value\",\n \"udf2\": \"some-value\"\n }\n }"
1076-
},
1077-
"Create a payment with address": {
1078-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"customer\": {\n \"id\" : \"cus_abcdefgh\"\n },\n \"billing\": {\n \"address\": {\n \"line1\": \"1467\",\n \"line2\": \"Harrison Street\",\n \"line3\": \"Harrison Street\",\n \"city\": \"San Fransico\",\n \"state\": \"California\",\n \"zip\": \"94122\",\n \"country\": \"US\",\n \"first_name\": \"joseph\",\n \"last_name\": \"Doe\"\n },\n \"phone\": {\n \"number\": \"8056594427\",\n \"country_code\": \"+91\"\n }\n }\n }"
1079-
},
1080-
"Create a payment with customer details": {
1081-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"customer\": {\n \"id\":\"cus_abcdefgh\",\n \"name\":\"John Dough\",\n \"phone\":\"9999999999\",\n \"email\":\"[email protected]\"\n }\n }"
1082-
},
1083-
"Create a payment with minimul fields": {
1084-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n }"
1085-
},
1086-
"Create a payment with order category for noon": {
1087-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"connector_metadata\": {\n \"noon\": {\n \"order_category\":\"shoes\"\n }\n }\n }"
1088-
},
1089-
"Create a payment with order details": {
1090-
"value": "{\n \"amount\": 6540,\n \"currency\": \"USD\",\n \"order_details\": [\n {\n \"product_name\": \"Apple iPhone 15\",\n \"quantity\": 1,\n \"amount\" : 6540\n }\n ]\n }"
1091-
}
10921066
}
10931067
}
10941068
},

0 commit comments

Comments
 (0)