diff --git a/coronavirus-tracker-api-swagger.yaml b/coronavirus-tracker-api-swagger.yaml new file mode 100644 index 00000000..d17b9d42 --- /dev/null +++ b/coronavirus-tracker-api-swagger.yaml @@ -0,0 +1,152 @@ +swagger: '2.0' +info: + description: 'Corona Virus Tracker API based on JHU data sets. https://github.com/ExpDev07/coronavirus-tracker-api' + version: 1.0.0 + title: Corona Virus Tracker API + contact: + url: https://github.com/ExpDev07/coronavirus-tracker-api +host: coronavirus-tracker-api.herokuapp.com +basePath: /v2 +schemes: + - https +paths: + /latest: + get: + summary: Latest global Corona stats + operationId: latest + produces: + - application/json + responses: + '200': + description: successful operation + schema: + type: object + properties: + latest: + type: object + properties: + confirmed: + type: number + example: 214910 + deaths: + type: number + example: 8733 + recovered: + type: number + example: 83207 + /locations: + get: + summary: All Locations + operationId: allLocations + produces: + - application/json + parameters: + - name: country_code + in: query + description: "ISO alpha 2 country code. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2" + required: false + type: string + x-example: US + - name: timelines + in: query + description: "Include timeline objects in response? true or false" + required: false + type: string + x-example: true + responses: + '200': + description: successful operation + schema: + type: object + properties: + locations: + type: array + items: + $ref: '#/definitions/Location' + '/locations/{id}': + get: + summary: location + operationId: location + produces: + - application/json + parameters: + - name: id + in: path + description: "Internal ID" + required: true + type: string + x-example: 39 + responses: + '200': + description: successful operation + schema: + type: object + properties: + location: + $ref: '#/definitions/Location' + '404': + description: Location not found +definitions: + Location: + type: object + properties: + coordinates: + type: object + properties: + latitude: + type: string + example: "47.4009" + longitude: + type: string + example: "-121.4905" + country: + type: string + example: "US" + country_code: + type: string + example: US + id: + type: number + example: 98 + latest: + type: object + properties: + confirmed: + type: number + example: 1014 + deaths: + type: number + example: 55 + recovered: + type: number + example: 10 + province: + type: string + example: "Washington" + timelines: + type: object + properties: + confirmed: + type: object + properties: + latest: + type: number + example: 1014 + timeline: + type: object + deaths: + type: object + properties: + latest: + type: number + example: 55 + timeline: + type: object + recovered: + type: object + properties: + latest: + type: number + example: 10 + timeline: + type: object