Acceptance Criteria:
- Define route for /page/{title}/history?{older_than|newer_than={id}}
- Define route handler for page history
- Request:
- Must support HTTP GET only
- Must support older_than or newer_than param, these parameters provide a revision id
- Only one of older_than or newer_than are supported for a request
- If both are provided the endpoint must return a meaningful error
- Only one of older_than or newer_than are supported for a request
- Must support title param, this provides the title of the requested page
- Request body must be empty
- Response
- Response must return JSON
- Responses JSON must have structure:
{ "older": "https://api.example/page/France/history?older_than=12345", "newer" "https://api.example/page/France/history?newer_than=67890" "latest": "https://api.full.url/page/some title/history", "revisions":[ { "id": 889268681, "comment": "Rm unnecessary space in comment; all the others have 8 at the beginning and end, this had 9", "timestamp": "2019-03-24T16:37:55Z", "delta": -1, "size": 441, "user": { "name": "The Blade of the Northern Lights", "id": 12345 } } ] }
- older must contain full link to API endpoint for the next older segment of results (usually the same endpoint plus "older_than" with the last revision in this segment). May be excluded if there are no known older revisions.
- newer must contain full link to API endpoint for the next newer segment of results (usually the same endpoint plus "newer_than" parameter for first revision in this segment). May be excluded if there are no known older revisions.
- latest must contain full link to API endpoint for the latest values, usually just this endpoint with no parameters
- older, newer, and latest must contain a fully qualified URL
- Number of revisions returned must be limited to 20
- Delta must contain +/- count of characters changed from previous revision