Skip to content

Commit

Permalink
fix (backend): move from deprecated example to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
brownben committed Dec 6, 2024
1 parent aa81c89 commit d1c25ad
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions backend/src/routes/competitor_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def get_all_competitor_pools() -> Iterable[str]:
async def get_leagues_in_competitor_pool(
name: str = Path(
title="Competitor Pool Name",
example="Edinburgh Winter 2020",
examples=["Edinburgh Winter 2020"],
),
) -> Iterable[League]:
return await Leagues.get_by_competitor_pool(name)
Expand All @@ -31,7 +31,7 @@ async def get_leagues_in_competitor_pool(
async def get_competitors_in_competitor_pool(
name: str = Path(
title="Competitor Pool Name",
example="Edinburgh Winter 2020",
examples=["Edinburgh Winter 2020"],
),
) -> Iterable[Competitor]:
return await Competitors.get_by_pool(name)
Expand All @@ -41,7 +41,7 @@ async def get_competitors_in_competitor_pool(
async def get_events_in_competitor_pool(
name: str = Path(
title="Competitor Pool Name",
example="Edinburgh Winter 2020",
examples=["Edinburgh Winter 2020"],
),
) -> Iterable[EventWithUploadKey]:
return await Events.get_by_competitor_pool(name)
6 changes: 3 additions & 3 deletions backend/src/routes/competitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def get_competitor_details(
id: int = Path(
title="Competitor ID",
description="ID of the competitor to fetch",
example=7,
examples=[7],
),
) -> Competitor:
result = await Competitors.get_by_id(id)
Expand All @@ -58,7 +58,7 @@ async def update_competitor_details(
id: int = Path(
title="Competitor ID",
description="ID of the competitor to fetch",
example=7,
examples=[7],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -75,7 +75,7 @@ async def get_overview_for_competitor(
id: int = Path(
title="Competitor ID",
description="ID of the competitor to fetch results for",
example=7,
examples=[7],
),
) -> CompetitorOverview:
competitor, results, league = await asyncio.gather(
Expand Down
10 changes: 5 additions & 5 deletions backend/src/routes/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def get_event_details(
id: str = Path(
title="Event ID",
description="ID of the event to fetch",
example="Tentsmuir2021-08-12",
examples=["Tentsmuir2021-08-12"],
),
) -> EventWithUploadKey:
result = await Events.get_by_id(id)
Expand All @@ -87,7 +87,7 @@ async def update_event_details(
id: str = Path(
title="Event ID",
description="ID of the event to fetch",
example="Tentsmuir2021-08-12",
examples=["Tentsmuir2021-08-12"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -109,7 +109,7 @@ async def delete_event(
id: str = Path(
title="Event ID",
description="ID of the event to fetch",
example="Tentsmuir2021-08-12",
examples=["Tentsmuir2021-08-12"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -123,7 +123,7 @@ async def get_event_details_with_upload_key(
id: str = Path(
title="Event ID",
description="ID of the event to fetch",
example="Tentsmuir2021-08-12",
examples=["Tentsmuir2021-08-12"],
),
authentication: bool = Depends(require_authentication),
) -> EventWithUploadKey:
Expand All @@ -140,7 +140,7 @@ async def get_results_for_event(
id: str = Path(
title="Event ID",
description="ID of the event to fetch results for",
example="Tentsmuir2021-08-12",
examples=["Tentsmuir2021-08-12"],
),
) -> EventWithResults:
event, results, league = await asyncio.gather(
Expand Down
48 changes: 24 additions & 24 deletions backend/src/routes/leagues.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def get_league_details(
name: str = Path(
title="League Name",
description="Name of the league to fetch",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
) -> LeagueOverviewAuthenticated:
return await get_league(name)
Expand All @@ -110,7 +110,7 @@ async def get_league_details_with_event_upload_keys(
name: str = Path(
title="League Name",
description="Name of the league to fetch",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
authentication: bool = Depends(require_authentication),
) -> LeagueOverviewAuthenticated:
Expand All @@ -123,7 +123,7 @@ async def update_league_details(
name: str = Path(
title="League Name",
description="Name of the league to update",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -140,7 +140,7 @@ async def delete_league(
name: str = Path(
title="League Name",
description="Name of the league to delete",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -154,7 +154,7 @@ async def get_league_events(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
) -> Iterable[EventWithLeagueDetailsAndUploadKey]:
league, events = await asyncio.gather(
Expand Down Expand Up @@ -188,7 +188,7 @@ async def get_league_events_calendar(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
) -> PlainTextResponse:
league, events = await asyncio.gather(
Expand Down Expand Up @@ -241,12 +241,12 @@ async def get_league_results(
league_name: str = Path(
title="League Name",
description="Name of the league to get the results for",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
cls: str = Path(
title="Class",
description="Name of the class to get results for",
example="Long",
examples=["Long"],
),
) -> LeagueResultsResponse:
league, events, league_class, league_classes, league_groups = await asyncio.gather(
Expand Down Expand Up @@ -345,7 +345,7 @@ async def get_league_classes(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
) -> Iterable[LeagueClass]:
league, classes = await asyncio.gather(
Expand All @@ -364,12 +364,12 @@ async def get_league_class(
league_name: str = Path(
title="League Name",
description="Name of the league ",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
cls: str = Path(
title="Class Name",
description="Name of the class",
example="Long",
examples=["Long"],
),
) -> LeagueClass:
result = await LeagueClasses.get_by_name(league_name, cls)
Expand All @@ -386,7 +386,7 @@ async def create_league_class(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand Down Expand Up @@ -414,12 +414,12 @@ async def update_league_class(
league_name: str = Path(
title="League Name",
description="Name of the league ",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
class_name: str = Path(
title="Class Name",
description="Name of the class",
example="Long",
examples=["Long"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -436,12 +436,12 @@ async def delete_league_class(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
name: str = Path(
title="Class Name",
description="Name of the league class to delete",
example="Long",
examples=["Long"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -455,7 +455,7 @@ async def get_league_groups(
league_name: str = Path(
title="League Name",
description="Name of the league ",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
) -> list[LeagueGroup]:
league, groups = await asyncio.gather(
Expand All @@ -474,12 +474,12 @@ async def get_league_group(
league_name: str = Path(
title="League Name",
description="Name of the league ",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
group: str = Path(
title="Group Name",
description="Name of the group",
example="Sprint",
examples=["Sprint"],
),
) -> LeagueGroup:
result = await LeagueGroups.get_by_name(league_name, group)
Expand All @@ -496,7 +496,7 @@ async def create_league_group(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand Down Expand Up @@ -524,12 +524,12 @@ async def update_league_group(
league_name: str = Path(
title="League Name",
description="Name of the league ",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
group_name: str = Path(
title="Group Name",
description="Name of the group",
example="Sprint",
examples=["Sprint"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand All @@ -546,12 +546,12 @@ async def delete_league_group(
league_name: str = Path(
title="League Name",
description="Name of the league",
example="Sprintelope 2021",
examples=["Sprintelope 2021"],
),
name: str = Path(
title="Group Name",
description="Name of the league group to delete",
example="Sprint",
examples=["Sprint"],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def update_result(
id: int = Path(
title="Competitor ID",
description="ID of the competitor to fetch",
example=7,
examples=[7],
),
authentication: bool = Depends(require_authentication),
) -> Message:
Expand Down

0 comments on commit d1c25ad

Please sign in to comment.