"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 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:
{ "next": "/page/Mars/references/?after=100", "prev": null, "first": "???", "refs": [ //array of Reference { "id": "ISBN 978-1-4614-2302-7", "work": // Work { "id": "some-title", "creator": //array of Persons [ { "id": "some-person-id", "name": "Grego, Peter" } ], "contributor": //array of Persons [ { "id": "some-person-id", "name": "person-name" } ], "publisher": // Publisher { "id": "publisher-id", "name": "Springer Science+Business Media" }, "date": "June 6, 2012", "description": "", "isPartOf": "???" //Propose to remove from PoC }, "pages": //Page Range { "from": 1, "to": 25 } }, ... 99 more ] }
Sources:
Plain text
Grego, Peter (June 6, 2012). Mars and How to Observe It. Springer Science+Business Media. p. 3. ISBN 978-1-4614-2302-7 – via Internet Archive.
Wikitext
<ref>{{cite book |first1=Peter |last1=Grego |title=Mars and How to Observe It |url=https://archive.org/details/marshowtoobserve0000greg |url-access=registration |page=[https://archive.org/details/marshowtoobserve0000greg/page/3 3] |publisher=[[Springer Science+Business Media]] |date=June 6, 2012 |isbn=978-1-4614-2302-7 |via=Internet Archive}}</ref>
Raw HTML
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7" aria-label="Jump up" title="Jump up">^</a></b></span> <span class="reference-text"><cite id="CITEREFGrego2012" class="citation book">Grego, Peter (June 6, 2012). <span class="cs1-lock-registration" title="Free registration required"><a rel="nofollow" class="external text" href="https://archive.org/details/marshowtoobserve0000greg"><i>Mars and How to Observe It</i></a></span>. <a href="/wiki/Springer_Science%2BBusiness_Media" title="Springer Science+Business Media">Springer Science+Business Media</a>. p. <a rel="nofollow" class="external text" href="https://archive.org/details/marshowtoobserve0000greg/page/3">3</a>. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-1-4614-2302-7" title="Special:BookSources/978-1-4614-2302-7"><bdi>978-1-4614-2302-7</bdi></a> – via Internet Archive.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Mars+and+How+to+Observe+It&rft.pages=3&rft.pub=Springer+Science%2BBusiness+Media&rft.date=2012-06-06&rft.isbn=978-1-4614-2302-7&rft.aulast=Grego&rft.aufirst=Peter&rft_id=https%3A%2F%2Farchive.org%2Fdetails%2Fmarshowtoobserve0000greg&rfr_id=info%3Asid%2Fen.wikipedia.org%3AMars" class="Z3988"></span><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r951705291"></span> </li>
<ref name="tesla01">{{cite magazine |url=https://babel.hathitrust.org/cgi/pt?id=uiug.30112109670726;view=1up;seq=157 |title=Talking with the Planets |magazine=[[Collier's]] |first=Nikola |last=Tesla |volume=26 |issue=19 |pages=4–5 |date=February 9, 1901}}</ref>