arturobernalg opened a new pull request, #654:
URL: https://github.com/apache/jspwiki/pull/654
Part of JSPWIKI-1310. This pull request builds on #589, #590, #645, #646,
#650 and #653, so it shows their commits until they are merged; the new commit
is the last one.
It adds GET /api/v1/pages/{name}/diff, to read the difference between two
versions of a page, as the wiki shows it. The parameter from is required, and
to is the latest version when it is absent. The answer is JSON with the name,
the two versions and the html of the difference, written by the difference
provider of the wiki.
- The permission to view is checked on the page before anything is read; a
page that does not exist, or a version that does not exist, is 404; a missing
or invalid version is 400; the errors are JSON like in the rest of the API.
- A provider that keeps no old versions answers with the current page
whatever version is asked for, so the servlet checks that the version it got is
the one that was asked for. Without it, from=9 would have compared the page
with itself and answered 200.
- openapi.yaml describes it, and ApiV1ServletTest has nine new tests, among
them the contract, the latest version by default, the two equal versions, 404
and 400, 401 without any text of the page, and a provider without versions.
I also ran it on a Tomcat 10.1 with the war of this branch, with the
versioning provider and a page with two versions: from 1 to 2 marks the added
line as the wiki does, to defaults to the latest version, the reverse
difference works, and version 9 is 404.
ChangeLog.md is updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]