Open
Conversation
c38933a to
709e389
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 5: Sports Service
The
sportmicroservice now exposes an AIP‑131 compliantListEventsplusGetEvent.Current Event fields:
id,competition_id,name,visible,advertised_start_time, derivedstatus(OPEN/CLOSED),sport_code.ListEvents(HTTP GET, namespaced) – structured query params (no free‑form filter string):page_size(int, <=200, default 50)page_token(cursor based pagination)visible(optional bool) – filter when presentsport_code(optional string) – equalitycompetition_id(repeatable) – e.g.&competition_id=1&competition_id=2status(OPEN or CLOSED) – omit for bothorder_by– field name (currently onlyadvertised_start_time)order_direction–asc(default) ordescExample: List first page (default order):
curl -s "http://localhost:8000/v1/sports/events?page_size=5"Response:
{ "events": [ { "id": "25", "competitionId": "2", "name": "Idaho ducks", "visible": true, "advertisedStartTime": "2025-08-16T14:20:40Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "59", "competitionId": "7", "name": "West Virginia crows", "visible": true, "advertisedStartTime": "2025-08-16T15:30:45Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "92", "competitionId": "3", "name": "Indiana werewolves", "visible": true, "advertisedStartTime": "2025-08-16T15:33:22Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "18", "competitionId": "1", "name": "New Hampshire penguins", "visible": true, "advertisedStartTime": "2025-08-16T15:40:13Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "21", "competitionId": "3", "name": "Alaska oxen", "visible": true, "advertisedStartTime": "2025-08-16T15:48:45Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" } ], "nextPageToken": "NQ==" }Example: Filter + order (visible SOCCER events newest first):
curl -s "http://localhost:8000/v1/sports/events?visible=true&sport_code=SOCCER&order_by=advertised_start_time&order_direction=desc&page_size=5"Response:
{ "events": [ { "id": "23", "competitionId": "8", "name": "Vermont rabbits", "visible": true, "advertisedStartTime": "2025-08-19T13:41:48Z", "status": "EVENT_STATUS_OPEN", "sportCode": "SOCCER" }, { "id": "64", "competitionId": "5", "name": "North Dakota birds", "visible": true, "advertisedStartTime": "2025-08-19T13:28:18Z", "status": "EVENT_STATUS_OPEN", "sportCode": "SOCCER" }, { "id": "15", "competitionId": "5", "name": "Georgia gooses", "visible": true, "advertisedStartTime": "2025-08-19T11:43:19Z", "status": "EVENT_STATUS_OPEN", "sportCode": "SOCCER" }, { "id": "27", "competitionId": "3", "name": "Maine oracles", "visible": true, "advertisedStartTime": "2025-08-19T10:58:52Z", "status": "EVENT_STATUS_OPEN", "sportCode": "SOCCER" }, { "id": "40", "competitionId": "7", "name": "Connecticut vampires", "visible": true, "advertisedStartTime": "2025-08-19T10:43:55Z", "status": "EVENT_STATUS_OPEN", "sportCode": "SOCCER" } ], "nextPageToken": "NQ==" }Example: Filter by competition ids and status:
curl -s "http://localhost:8000/v1/sports/events?competition_id=1&competition_id=2&competition_id=3&status=OPEN&order_by=advertised_start_time&order_direction=asc&page_size=10"Response:
{ "events": [ { "id": "25", "competitionId": "2", "name": "Idaho ducks", "visible": true, "advertisedStartTime": "2025-08-16T14:20:40Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "92", "competitionId": "3", "name": "Indiana werewolves", "visible": true, "advertisedStartTime": "2025-08-16T15:33:22Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "18", "competitionId": "1", "name": "New Hampshire penguins", "visible": true, "advertisedStartTime": "2025-08-16T15:40:13Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "21", "competitionId": "3", "name": "Alaska oxen", "visible": true, "advertisedStartTime": "2025-08-16T15:48:45Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "68", "competitionId": "3", "name": "Pennsylvania banshees", "visible": true, "advertisedStartTime": "2025-08-16T15:55:03Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "44", "competitionId": "3", "name": "Arizona bears", "visible": false, "advertisedStartTime": "2025-08-16T16:59:11Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "11", "competitionId": "3", "name": "New Hampshire owls", "visible": false, "advertisedStartTime": "2025-08-16T17:04:23Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "43", "competitionId": "1", "name": "Kansas penguins", "visible": false, "advertisedStartTime": "2025-08-16T17:59:21Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "78", "competitionId": "1", "name": "Hawaii geese", "visible": true, "advertisedStartTime": "2025-08-16T21:01:40Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "48", "competitionId": "1", "name": "Montana ducks", "visible": false, "advertisedStartTime": "2025-08-16T23:06:49Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" } ], "nextPageToken": "MTA=" }Example: Paging ( next_page_token from previous response):
curl -s "http://localhost:8000/v1/sports/events?page_size=5&page_token=MTA="Response:
{ "events": [ { "id": "24", "competitionId": "5", "name": "Idaho ghosts", "visible": true, "advertisedStartTime": "2025-08-16T17:05:57Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "43", "competitionId": "1", "name": "Kansas penguins", "visible": false, "advertisedStartTime": "2025-08-16T17:59:21Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "85", "competitionId": "6", "name": "Nebraska witches", "visible": true, "advertisedStartTime": "2025-08-16T20:51:43Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "78", "competitionId": "1", "name": "Hawaii geese", "visible": true, "advertisedStartTime": "2025-08-16T21:01:40Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }, { "id": "48", "competitionId": "1", "name": "Montana ducks", "visible": false, "advertisedStartTime": "2025-08-16T23:06:49Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" } ], "nextPageToken": "MTU=" }Example: Get event
curl -s "http://localhost:8000/v1/sports/events/123"Response:
{ "id": "5", "competitionId": "2", "name": "Missouri ogres", "visible": false, "advertisedStartTime": "2025-08-17T22:17:22Z", "status": "EVENT_STATUS_CLOSED", "sportCode": "SOCCER" }