-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Worked Example: Lucan GP #57
Comments
In this use case the circuit is not explicitly stated in the event information. If it is to be included in the event it will need to be inferred some other way, e.g. by searching Strava activities for previous editions. We will represent this in the test case by creating the event without a circuit initially, and perhaps adding one later. |
In this case the organising club/contacts information is on the calendar page and not on the event details page, so that will be an important source of information too when parsing events automatically. |
Club EntitiesI need to separate the club entity from the POST event request, since we won't be recreating clubs on every event. club:
id: Lucan Cycling Road Club
...
event:
organised_by:
club_id: Lucan Cycling Road Club Or event:
organised_by:
club_id: {club_id} |
Event MediaAdd a field media:
poster: Event PostersMany of the better promoted events have poster images. These can be highly informative and will be important to display to athletes, but they will be impossible to parse programmatically. |
HandicappingThe stage entity's Conflicting InformationThis use case has a conflict between the event details page and the event poster. Conflict ResolutionIn this case the conflict is resolved in favour of the event poster. In an automated system it would probably require a user to flag the event has having a discrepancy/error and an administrator to review and correct it. |
Courses without CircuitsIn this use case as in many the event details page indicates the distance of the races but not the route/course/circuit. |
Updating Entities: All or Nothing?Should POST updates for entities include all entity data or just that which is changing? YAML FragmentsWrt writing yaml testcases there's an elegant solution: include the POST request payload in PUT requests as a reference to a yaml fragment, and override the changed properties. request:
url: "{api.server}/api/events/{event_id}"
json:
<<: *initial_event_info
changed_properties: Determination: PUT AllFor now we will assume that PUT requests contain all the state of the entity being updated. |
Representing Relationships: Nested or Linked Entities?How should the API model represent referenced entities, especially entities that are shared? For example, a single HATEOASAccording to strict hypermedia representational principles like HATEOAS relationships between resources should be represented as url-addressable title: Lucan GP
id: {id}
links:
self:
href: /events/{id}
rel: self
organising_club:
- href: /clubs/lrcc
rel: club
races:
- href: /stages/{headline_race_id}
rel: race
- href: /stages/{a4_race_id}
rel: race The hypermedia principle theoretically supports programmatic navigation by clients by providing them with the complete set of permissible operations in every REST API response. E.g.
The hypermedia principle extends from the web paradigm where servers have little control over clients; They know little more than that their clients are web browsers that may navigate across the network of resources linked to in the server's responses. In most practical applications, and certainly in this project's case, there is much more control over the client(s) and its requirements. For us there will be one client initially (in support of a web application with possible mobile application clients added later), a JavaScript library rendering application resources in a web UI. Object LinksA compromise approach that adopts advantages of both hypermedia and domain-application principles is to federate resources and include links to each. 1 title: Lucan GP
id: {id}
href: /events/{id}
organised_by:
club:
title: Lucan Road Cycling Club
href: /clubs/lrcc
races:
- href: /events/{id}/races/{stage_id_a123}
- href: /events/{id}/races/{stage_id_a4W} PatternAll complex reusable objects are represented as URL addressable resources. id: {id}
href: {self_url}
title:
b:
href: {b_url}
id:
title:
id:
title:
c:
href: |
Create another worked example test case to shake out any further requirements and evaluate the enhancements delivered to support the Laragh Classic use case.
Cycling Ireland Event URL: https://cyclingireland.azolve.com/Workbench.mvc/public/eventDetails?EventId=1074983
The text was updated successfully, but these errors were encountered: