Description
Modify the /election GET endpoints to optionally return an array of nominees for each election. have an array of nominees attached to each election response object.
Use a query parameter of with_nominees=<truthy> to indicate that the response should contain the list of nominees for that election. Any other value or a missing value should not contain the list. See the link below for which values are considered truthy.
Features
/election updated
/election/{election_name} updated
- Tests that validate this behaviour
Resources
Docs on how query parameters work in FastAPI: https://fastapi.tiangolo.com/tutorial/query-params/#query-parameter-type-conversion
Description
Modify the
/electionGET endpoints to optionally return an array of nominees for each election. have an array of nominees attached to each election response object.Use a query parameter of
with_nominees=<truthy>to indicate that the response should contain the list of nominees for that election. Any other value or a missing value should not contain the list. See the link below for which values are considered truthy.Features
/electionupdated/election/{election_name}updatedResources
Docs on how query parameters work in FastAPI: https://fastapi.tiangolo.com/tutorial/query-params/#query-parameter-type-conversion