These task depends on T231586
Acceptance Criteria:
- Define route for /revision/{id}/compare/{other}
- Ensure wiring is available to wikidiff2 instance described in T231586
- Define route handler for compare that handles the following:
- Request:
- Must support HTTP GET/HEAD only
- Response:
- Response must return JSON
- Responses JSON must have structure:
{ "from": { "id": 889268680 } "to": { "id": 848883822 } "diff": /* output from wikidiff2 */ }
- diff: A diff giving the changes associated with the specified slot role. The diff format may depend on the content handler but is expected to be a JSON diff as generated by wikidiff2_inline_json_diff(). Such a JSON diff is an object with a single top-level key "diff".
- Response headers must contain:
- Response Statuses
- 200 - OK
- 400 - from and to IDs are from different pages or content type is not wikitext
- 404 - One or both version IDs don't exist