Skip to content

Commit b1a4742

Browse files
committed
update versions and response models
1 parent 033d924 commit b1a4742

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/main.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,26 @@ class Location(pydantic.BaseModel):
5454
APP = fastapi.FastAPI(
5555
title="Coronavirus Tracker",
5656
description="API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak.",
57-
version="3.0.0",
58-
prefix="/v3",
59-
docs_url="/v3",
57+
version="2.1.0",
58+
prefix="/v2-1",
59+
docs_url="/v2-1",
6060
redoc_url="/docs",
6161
)
6262

6363

6464
@APP.get("/latest", response_model=Latest)
6565
def get_latest():
66+
"""Getting latest amount of total confirmed cases, deaths, and recoveries."""
6667
sample_data = {"latest": {"confirmed": 197146, "deaths": 7905, "recovered": 80840}}
6768
return sample_data
6869

6970

70-
@APP.get("/locations")
71+
@APP.get("/locations", response_model=AllLocations)
7172
def get_all_locations(country_code: str = None, timelines: int = None):
7273
return
7374

7475

75-
@APP.get("/locations/{id}")
76+
@APP.get("/locations/{id}", response_model=Location)
7677
def get_location_by_id(id: int):
7778
return
7879

0 commit comments

Comments
 (0)