camparchimedes commited on
Commit
a6e4abe
ยท
verified ยท
1 Parent(s): 2bb026b

Update api_docs_mck.py

Browse files
Files changed (1) hide show
  1. api_docs_mck.py +72 -21
api_docs_mck.py CHANGED
@@ -2,37 +2,88 @@
2
 
3
  import json
4
 
 
5
  api_docs = {
6
- "api_url": "https://670dccd0073307b4ee447f2f.mockapi.io/daysoff/api/V1/booking",
7
  "endpoints": {
8
- "method": "GET",
9
- "description": "Retrieve booking details for a given booking ID.",
10
- "parameters": {
11
- "booking_id": {
12
- "type": "string",
13
- "description": "Alphanumeric identifier, (6 capital letters followed by 6 digits, e.g., DAGHNS116478) of the booking to retrieve.",
14
- "regex_pattern": "^[A-Z]{6}\\d{6}$"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  },
17
- "headers": {
18
- "Content-Type": "application/json"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  },
20
- "api_response": {
21
- "description": "A JSON object containing booking details.",
22
- "content_type": "application/json",
23
- "Her er informasjon vi har registrert om bestilligen": {
24
- "booking_id": "response.get('booking_id', 'N/A')",
25
- "full_name": "response.get('full_name', 'N/A')",
26
- "amount": "response.get('amount', 'N/A')",
27
- "date": "response.get('date', 'N/A')",
28
- "address": "response.get('address', 'N/A')",
29
- "user_id": "response.get('user_id', 'N/A')"
 
 
 
 
 
 
 
 
 
30
  }
31
  }
32
  }
33
  }
34
 
35
-
36
  api_docs_str = json.dumps(api_docs, indent=2)
37
  api_docs_str
38
 
 
2
 
3
  import json
4
 
5
+ # API Documentation
6
  api_docs = {
7
+ "base_url": "https://670dccd0073307b4ee447f2f.mockapi.io/daysoff/api/V1/",
8
  "endpoints": {
9
+ "booking_info": {
10
+ "method": "GET",
11
+ "url": "booking",
12
+ "description": "Retrieve booking information for all or a specific booking ID.",
13
+ "parameters": {
14
+ "booking_id": {
15
+ "type": "string",
16
+ "description": "The unique identifier of the booking to retrieve (e.g., 'OIGLFD786354')."
17
+ }
18
+ },
19
+ "headers": {
20
+ "Content-Type": "application/json"
21
+ },
22
+ "response": {
23
+ "description": "Details about a specific booking.",
24
+ "content_type": "application/json",
25
+ "template": {
26
+ "requestId": "$datatype.uuid",
27
+ "items": "$mockData",
28
+ "count": "$count",
29
+ "fields": {
30
+ "booking_id": "$mockData.booking_id",
31
+ "full_name": "$mockData.full_name",
32
+ "amount": "$mockData.amount",
33
+ "checkin": "$mockData.checkin",
34
+ "checkout": "$mockData.checkout",
35
+ "address": "$mockData.address",
36
+ "user_id": "$mockData.user_id"
37
+ }
38
+ }
39
  }
40
  },
41
+ "firmahytteordning": {
42
+ "method": "GET",
43
+ "url": "firmahytteordning",
44
+ "description": "Retrieve details about the 'Firmahytteordning' service.",
45
+ "headers": {
46
+ "Content-Type": "application/json"
47
+ },
48
+ "response": {
49
+ "description": "Information about DaysOff's Firmahytteordning.",
50
+ "content_type": "application/json",
51
+ "template": {
52
+ "requestId": "$datatype.uuid",
53
+ "items": "$mockData",
54
+ "count": "$count",
55
+ "fields": {
56
+ "title": "$mockData.title",
57
+ "content": "$mockData.content"
58
+ }
59
+ }
60
+ }
61
  },
62
+ "privacy_policy": {
63
+ "method": "GET",
64
+ "url": "privacy-policy",
65
+ "description": "Retrieve the privacy policy for DaysOff.",
66
+ "headers": {
67
+ "Content-Type": "application/json"
68
+ },
69
+ "response": {
70
+ "description": "DaysOff's privacy policy.",
71
+ "content_type": "application/json",
72
+ "template": {
73
+ "requestId": "$datatype.uuid",
74
+ "items": "$mockData",
75
+ "count": "$count",
76
+ "fields": {
77
+ "title": "$mockData.title",
78
+ "content": "$mockData.content"
79
+ }
80
+ }
81
  }
82
  }
83
  }
84
  }
85
 
86
+ # Convert to JSON string for usage in your Python application
87
  api_docs_str = json.dumps(api_docs, indent=2)
88
  api_docs_str
89