Skip to content

Add support for generating OpenAPI documentation

Manuel Prinz requested to merge restdocs-api-spec into master

This is some minimally working example of how we could generate OpenAPI documentation via RestDocs. I just used their provided wrapper to wrap around the code we already have. This will not allow support for all features and misses some of the documentation. It might also need changes in other places. (It seems we might need to remove the "/api" from all endpoints to make it "proper".) There seem to be grouping issues, and issues with the URLs. The later ones should be fixed if we use URL templates in the tests, which we do not do in all places. Some other features in OpenAPI that are not supported in RestDocs directly can only be accessed by modifying the test code. I have a simple wrapper working that minimizes these changes, but I need to test it some more.

If you want to try it, you need to run the asciidoctor task first, and then the openapi3 task. The later will also run tests that are not needed, for reasons I do not understand. I will need to hook up the tasks correctly in the build system, but since it is nowhere near usable in this state, I did not bother with it yet.

Let me know what you think!

Merge request reports