Update api_docs.py
Browse files- api_docs.py +31 -13
api_docs.py
CHANGED
@@ -14,26 +14,44 @@ api_docs = {
|
|
14 |
"booking_id": "string"
|
15 |
},
|
16 |
"headers": {
|
17 |
-
"Authorization": "<auth_token>",
|
18 |
"Content-Type": "application/json"
|
19 |
},
|
|
|
20 |
"response": {
|
21 |
-
"description": "A JSON object containing booking details for a specific booking
|
22 |
-
"
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
33 |
}
|
34 |
}
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
api_docs_str = json.dumps(api_docs, indent=2)
|
39 |
api_docs_str
|
|
|
14 |
"booking_id": "string"
|
15 |
},
|
16 |
"headers": {
|
17 |
+
"Authorization": "Bearer <auth_token>",
|
18 |
"Content-Type": "application/json"
|
19 |
},
|
20 |
+
|
21 |
"response": {
|
22 |
+
"description": "A JSON object containing booking details for a specific booking id.",
|
23 |
+
"content_type": "application/json",
|
24 |
+
"fields": {
|
25 |
+
"booking_id": "The unique identifier for the booking.",
|
26 |
+
"full_name": "The full name of the customer associated with the booking.",
|
27 |
+
"amount": "The total amount for the booking (integer).",
|
28 |
+
"checkin": "The check-in date for the booking.",
|
29 |
+
"checkout": "The check-out date for the booking.",
|
30 |
+
"address": "The address associated with the booking.",
|
31 |
+
"user_id": "The user ID associated with the booking (integer).",
|
32 |
+
"infotext": "Additional information related to the booking.",
|
33 |
+
"included": "Details of services included in the booking."
|
34 |
+
}
|
35 |
}
|
36 |
}
|
37 |
}
|
38 |
|
39 |
+
# --actual response handling with .get() and mapping entries methods are request handling code, not in here (API documentation).
|
40 |
+
#"response": {
|
41 |
+
#"description": "A JSON object containing booking details for a specific booking ID.",
|
42 |
+
#"content_type": "application/json",
|
43 |
+
#"booking_info": {
|
44 |
+
#"booking_id": {"description": "The unique identifier for the booking.", "mapping": "response.get('booking_id', 'N/A')"},
|
45 |
+
#"full_name": {"description": "The full name of the customer associated with the booking.", "mapping": "response.get('full_name', 'N/A')"},
|
46 |
+
#"amount": {"description": "The total amount for the booking (integer).", "mapping": "response.get('amount', 0)"},
|
47 |
+
#"checkin": {"description": "The check-in date for the booking (ISO 8601).", "mapping": "response.get('checkin', 'N/A')"}, # --datetime format is 2024-12-20T15:00:00
|
48 |
+
#"checkout": {"description": "The check-out date for the booking (ISO 8601).", "mapping": "response.get('checkout', 'N/A')"},
|
49 |
+
#"address": {"description": "The address associated with the booking.", "mapping": "response.get('address', 'N/A')"},
|
50 |
+
#"user_id": {"description": "The user ID associated with the booking (integer).", "mapping": "response.get('user_id', 0)"},
|
51 |
+
#"infotext": {"description": "Additional information related to the booking.", "mapping": "response.get('infotext', 'N/A')"},
|
52 |
+
#"included": {"description": "Details of services included in the booking.", "mapping": "response.get('included', 'N/A')"}
|
53 |
+
#}
|
54 |
+
#}
|
55 |
|
56 |
api_docs_str = json.dumps(api_docs, indent=2)
|
57 |
api_docs_str
|