Skip to content

Commit b10503a

Browse files
committed
docs: regenerate swagger documentation
- Update swagger docs with latest API definitions - Refresh docs.go, swagger.json, and swagger.yaml files
1 parent 7525973 commit b10503a

File tree

3 files changed

+299
-182
lines changed

3 files changed

+299
-182
lines changed

docs/docs.go

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const docTemplate = `{
117117
},
118118
"/national": {
119119
"get": {
120-
"description": "Retrieve national COVID-19 cases data with optional date range filtering",
120+
"description": "Retrieve national COVID-19 cases data with optional date range filtering and sorting",
121121
"consumes": [
122122
"application/json"
123123
],
@@ -140,6 +140,12 @@ const docTemplate = `{
140140
"description": "End date (YYYY-MM-DD)",
141141
"name": "end_date",
142142
"in": "query"
143+
},
144+
{
145+
"type": "string",
146+
"description": "Sort by field:order (e.g., date:desc, positive:asc). Default: date:asc",
147+
"name": "sort",
148+
"in": "query"
143149
}
144150
],
145151
"responses": {
@@ -162,6 +168,16 @@ const docTemplate = `{
162168
}
163169
}
164170
]
171+
},
172+
"headers": {
173+
"X-RateLimit-Limit": {
174+
"type": "string",
175+
"description": "Request limit per window"
176+
},
177+
"X-RateLimit-Remaining": {
178+
"type": "string",
179+
"description": "Requests remaining in current window"
180+
}
165181
}
166182
},
167183
"400": {
@@ -170,6 +186,22 @@ const docTemplate = `{
170186
"$ref": "#/definitions/handler.Response"
171187
}
172188
},
189+
"429": {
190+
"description": "Rate limit exceeded",
191+
"schema": {
192+
"$ref": "#/definitions/handler.Response"
193+
},
194+
"headers": {
195+
"Retry-After": {
196+
"type": "string",
197+
"description": "Seconds to wait before retrying"
198+
},
199+
"X-RateLimit-Reset": {
200+
"type": "string",
201+
"description": "Unix timestamp when rate limit resets"
202+
}
203+
}
204+
},
173205
"500": {
174206
"description": "Internal Server Error",
175207
"schema": {
@@ -321,6 +353,12 @@ const docTemplate = `{
321353
"description": "End date (YYYY-MM-DD)",
322354
"name": "end_date",
323355
"in": "query"
356+
},
357+
{
358+
"type": "string",
359+
"description": "Sort by field:order (e.g., date:desc, positive:asc). Default: date:asc",
360+
"name": "sort",
361+
"in": "query"
324362
}
325363
],
326364
"responses": {
@@ -409,6 +447,12 @@ const docTemplate = `{
409447
"description": "End date (YYYY-MM-DD)",
410448
"name": "end_date",
411449
"in": "query"
450+
},
451+
{
452+
"type": "string",
453+
"description": "Sort by field:order (e.g., date:desc, positive:asc). Default: date:asc",
454+
"name": "sort",
455+
"in": "query"
412456
}
413457
],
414458
"responses": {
@@ -776,7 +820,7 @@ var SwaggerInfo = &swag.Spec{
776820
BasePath: "/api/v1",
777821
Schemes: []string{"https", "http"},
778822
Title: "Sulawesi Tengah COVID-19 Data API",
779-
Description: "A comprehensive REST API for COVID-19 data in Sulawesi Tengah (Central Sulawesi), with additional national and provincial data for context. Features enhanced ODP/PDP grouping and hybrid pagination.",
823+
Description: "A comprehensive REST API for COVID-19 data in Sulawesi Tengah (Central Sulawesi), with additional national and provincial data for context. Features enhanced ODP/PDP grouping, hybrid pagination, and rate limiting protection. Rate limiting: 100 requests per minute per IP address by default, with appropriate HTTP headers for client guidance.",
780824
InfoInstanceName: "swagger",
781825
SwaggerTemplate: docTemplate,
782826
LeftDelim: "{{",

docs/swagger.json

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
],
66
"swagger": "2.0",
77
"info": {
8-
"description": "A comprehensive REST API for COVID-19 data in Sulawesi Tengah (Central Sulawesi), with additional national and provincial data for context. Features enhanced ODP/PDP grouping and hybrid pagination.",
8+
"description": "A comprehensive REST API for COVID-19 data in Sulawesi Tengah (Central Sulawesi), with additional national and provincial data for context. Features enhanced ODP/PDP grouping, hybrid pagination, and rate limiting protection. Rate limiting: 100 requests per minute per IP address by default, with appropriate HTTP headers for client guidance.",
99
"title": "Sulawesi Tengah COVID-19 Data API",
1010
"termsOfService": "http://swagger.io/terms/",
1111
"contact": {
@@ -115,7 +115,7 @@
115115
},
116116
"/national": {
117117
"get": {
118-
"description": "Retrieve national COVID-19 cases data with optional date range filtering",
118+
"description": "Retrieve national COVID-19 cases data with optional date range filtering and sorting",
119119
"consumes": [
120120
"application/json"
121121
],
@@ -138,6 +138,12 @@
138138
"description": "End date (YYYY-MM-DD)",
139139
"name": "end_date",
140140
"in": "query"
141+
},
142+
{
143+
"type": "string",
144+
"description": "Sort by field:order (e.g., date:desc, positive:asc). Default: date:asc",
145+
"name": "sort",
146+
"in": "query"
141147
}
142148
],
143149
"responses": {
@@ -160,6 +166,16 @@
160166
}
161167
}
162168
]
169+
},
170+
"headers": {
171+
"X-RateLimit-Limit": {
172+
"type": "string",
173+
"description": "Request limit per window"
174+
},
175+
"X-RateLimit-Remaining": {
176+
"type": "string",
177+
"description": "Requests remaining in current window"
178+
}
163179
}
164180
},
165181
"400": {
@@ -168,6 +184,22 @@
168184
"$ref": "#/definitions/handler.Response"
169185
}
170186
},
187+
"429": {
188+
"description": "Rate limit exceeded",
189+
"schema": {
190+
"$ref": "#/definitions/handler.Response"
191+
},
192+
"headers": {
193+
"Retry-After": {
194+
"type": "string",
195+
"description": "Seconds to wait before retrying"
196+
},
197+
"X-RateLimit-Reset": {
198+
"type": "string",
199+
"description": "Unix timestamp when rate limit resets"
200+
}
201+
}
202+
},
171203
"500": {
172204
"description": "Internal Server Error",
173205
"schema": {
@@ -319,6 +351,12 @@
319351
"description": "End date (YYYY-MM-DD)",
320352
"name": "end_date",
321353
"in": "query"
354+
},
355+
{
356+
"type": "string",
357+
"description": "Sort by field:order (e.g., date:desc, positive:asc). Default: date:asc",
358+
"name": "sort",
359+
"in": "query"
322360
}
323361
],
324362
"responses": {
@@ -407,6 +445,12 @@
407445
"description": "End date (YYYY-MM-DD)",
408446
"name": "end_date",
409447
"in": "query"
448+
},
449+
{
450+
"type": "string",
451+
"description": "Sort by field:order (e.g., date:desc, positive:asc). Default: date:asc",
452+
"name": "sort",
453+
"in": "query"
410454
}
411455
],
412456
"responses": {

0 commit comments

Comments
 (0)