Repository navigation
JSPWIKI-1310 Move the REST API to the module jspwiki-rest-api and write its JSON with Jackson - #650
arturobernalg wants to merge 29 commits into
Conversation
…n OpenAPI file that a test compares with the answers
… the REST API version 1
# Conflicts: # ChangeLog.md
…o feature/JSPWIKI-1310-plugins-suggestions # Conflicts: # ChangeLog.md
…310-plugins-suggestions
…310-search # Conflicts: # ChangeLog.md
…310-plugins-suggestions # Conflicts: # ChangeLog.md
…s to the REST API version 1
…310-search # Conflicts: # ChangeLog.md
…o feature/JSPWIKI-1310-plugins-suggestions # Conflicts: # ChangeLog.md # jspwiki-main/src/main/java/org/apache/wiki/search/DefaultSearchManager.java
…gestions' into feature/JSPWIKI-1310-pages-read
…HTML to the REST API version 1
…the pages in the REST API
… into feature/JSPWIKI-1310-pages-list # Conflicts: # jspwiki-main/src/test/java/org/apache/wiki/rest/ApiV1ServletTest.java
…t do not wait for it
…o feature/JSPWIKI-1310-plugins-suggestions
…gestions' into feature/JSPWIKI-1310-pages-read
… into feature/JSPWIKI-1310-pages-list
…o feature/JSPWIKI-1310-plugins-suggestions
…gestions' into feature/JSPWIKI-1310-pages-read # Conflicts: # ChangeLog.md
… into feature/JSPWIKI-1310-pages-list # Conflicts: # ChangeLog.md
…te its JSON with Jackson
…d a description that broke the JAX-RS generator
|
Juan Pablo, about openapi-generator, which I said I would check: I ran openapi-generator 7.27.0 on openapi.yaml. It validates without warnings. The Java client (native library) compiles, and I used it against a running wiki (Tomcat with the war of this branch): listing pages, reading a page, its history, its html, references, attachments, the plugins and the search all return what the client expects, and a 404 arrives as an ApiException with the message. The generator for JAX-RS interfaces (jaxrs-spec) compiles too. It showed two small problems in the description, fixed in the last commit of this pull request: a description with double quotes made the JAX-RS generator write code that does not compile, and without tags everything ended in one class, so the operations now have the tags Search, Plugins and Pages. About the endorsed library: this API is a plain servlet and uses no JAX-RS, so I do not need it for now. If you had something else in mind for it, please tell me. |
Part of JSPWIKI-1310. This pull request builds on #589, #590, #645 and #646, so it shows their commits until they are merged; the new commit is the last one.
It does the two changes that Juan Pablo asked for in #589:
jspwiki-rest-api: the servlet,openapi.yamland the tests moved fromjspwiki-mainwithout a change of package or class name, so theweb.xmlof the war is the same. The war, the BOM and the root pom list the new module.jspwiki-maindoes not depend on it.The tests moved too and read the answers with Jackson. They need the user and group databases of the tests of
jspwiki-main, which they read from the file system, so the module has a copy of those two files in its test resources.Checked: the 41 tests of the module pass, and a war built from this branch in Tomcat 10.1 answered the list of pages, a page, its history, attachments, references and HTML, a page with an ACL (401), an unknown page (404) and a bad offset (400). Not tried: the search in that war, whose index was not built yet (the tests cover it).
Not done, because it is a bigger change: Alex's idea to use the plugin system of
WikiAjaxServlet.