-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
111 lines (110 loc) · 3.29 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Copyright 2020, Chaitanya Prakash N <[email protected]>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
swagger: "2.0"
info:
description: "API that provides current official Coronavirus COVID-19 cases data in India directly from the Ministry of Health and Family Welfare, [https://www.mohfw.gov.in](https://www.mohfw.gov.in)."
version: "1.0.0"
title: "COVID-19 India API"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
tags:
- name: "current official data"
description: "Get current data from MoHFW website"
externalDocs:
description: "Source"
url: "https://www.mohfw.gov.in"
schemes:
- "http"
paths:
/v1/data/current:
get:
tags:
- "current official data"
summary: "Fetch the latest COVID-19 data from https://www.mohfw.gov.in"
operationId: "getCurrentData"
produces:
- "application/json"
responses:
200:
description: "fetch data successful"
schema:
$ref: "#/definitions/COVIDData"
500:
description: "error while fetching the data"
schema:
$ref: "#/definitions/ErrorMessage"
definitions:
COVIDData:
type: "object"
properties:
updatedAt:
type: "string"
format: "date-time"
description: "Time when the stats are last updated"
name:
type: "string"
description: "Country name"
example: "India"
cases:
$ref: "#/definitions/CasesData"
states:
type: "array"
items:
$ref: "#/definitions/StatesData"
CasesData:
type: "object"
properties:
active:
type: "integer"
format: "int32"
description: "Total number of active cases"
example: 123
cured:
type: "integer"
format: "int32"
description: "Total number of cured / discharged cases"
example: 100
deaths:
type: "integer"
format: "int32"
description: "Total number of COVID related deaths"
example: 50
migrated:
type: "integer"
format: "int32"
description: "Total number of migrated cases"
example: 1
total:
type: "integer"
format: "int32"
description: "Total number of COVID-19 cases. Sum of total active, cured, deaths and migrated cases"
example: 174
StatesData:
type: "object"
properties:
name:
type: "string"
description: "Name of the state"
example: "Andhra Pradesh"
cases:
$ref: "#/definitions/CasesData"
ErrorMessage:
type: "object"
properties:
error:
type: "string"
description: "error description"
example: "ENOENT the host name specified is not found"