"As a Reader, I want to have a list of all references on a page, so that I can review and compare them in different ways."
Probably a paginated list. Contents of the reference TBD, but probably fair to say it would be a "short" version, with longer version. Should include the anchor(s) in the page.
----
GET /page/{title}/references?(before={before}|after={after})
Return one section of the list of references for the page.
Parameters:
* title: title of the page
* before: if provided, only show references strictly before this id (non-inclusive). This is primarily for segmenting the list.
* after: if provided, only show references strictly after this id (non-inclusive). Also for segmentation. Only one of before or after are allowed.
Notable headers: none
Request body: none
Status codes:
- 200: OK
- 404: No such title
- 400: No such id, or wrong parameters (both before and after)
Notable response headers: none
Response body: JSON object, with these properties:
next: full url of the next segment of the list, null if no more segments
prev: full url of the previous segment of the list, null if this is the first segment
first: full url of the first segment of the list
references: array of Reference objects from the [[ https://www.mediawiki.org/wiki/Core_Platform_Team/Initiative/References_API/Schema | Schema ]], up to 100. In the order that they appear in the page
#### Done Criteria
[ ] One section of the list of references is returned for a given page;
[ ] The proper status code is returned for each of three conditions/cases:
- 200 - Title is valid and exists (It would be great to add an example)
- 404 - Title is valid but doesn't exist (It would be great to add an example)
- 400 - Title is invalid (Example)
[ ] Returned list must be segmented based on a LIMIT of 100 items;
[ ] Response object should match examples:;
[ ] Response object must contain the following fields:
- next: full url of the next segment of the list, null if no more segments;
- prev: full url of the previous segment of the list, null if this is the first segment;
- first: full url of the first segment of the list.
- references: array of Reference objects, in the order that they appear in the page
[ ] Reference object must contain the following fields:
- id;
- work;
- pages;
[ ] Unit tests should cover 100% of code
[ ] Integration tests should automatically verify acceptance criteria.
#### Examples (assuming en.wikipedia.org):
Request:
GET: /page/Mars/references
Response:
Code:200
Body:
```lang = json
{
"next": "/page/Mars/references/?after=100",
"prev": null,
"first": "???",
"refs": [ { //array of work
"id": "some-id",
"title": "some-title",
"creator": [ //array of Persons
{ id: "some-person-id", "name": "person-name" }
],
"contributor": [ //array of Persons
{ "id": "some-person-id", "name": "person-name" }
],
"publisher": { // Publisher
"id": "publisher-id",
"name": "publisher-name"
},
},
... 99 more
]
}
```