I’ve put two new Open Source projects on GitHub: LunaAPIDocGen and LunaAPI2Swagger.
LunaAPIDocGen makes it easy to document your API calls.
It generates the necessary definition to generate Swagger (OpenAPI 2.0) documentation with LunaAPI2Swagger and Markdown documentation that can be processed with xjDocs by Park Bench Software. The generated definitions can then be transfered to LunaAPI2Swagger through IDE scripting for further processing.
LunaAPI2Swagger runs the tests generated by LunaAPIDocGen, generates the Swagger (OpenAPI 2.0) definition and stores the result of the tests.
This makes it possible to do Unit Tests on your API by comparing the results of the previous run with the current run.
To make this possible Reset capability has been added to Luna itself, so that you can always starts from the same initial situation.
xjDocs can further be used to generated a website with additional information on how to use the API, including automatically generated examples based on the test run.
A Luna update with the necessary CORS support and reset functionality for the Unit tests has been released as well.
In addition, a new Web site has been created, located at https://www.lunaapi.ga/
The site has links to the source code repositories at GitHub and has a demo page with:
a YouTube video showing how to add an api call to the documentation a link to the automatically generated Swagger document a link to the automatically generated xjDocs documentation
If anyone has feedback, it’s more than welcome.
If the documentation is not clear enough, please let me know.
Since it’s Open Source, you can fork it if you want, and you push changes back if your want.
Since Luna was MIT Licensed, I’ve also used the MIT License.
The Licenses of the other software that was used can be found in notes in the Project and on the GitHub pages.
If @Paul Lefebvre could add these project to the Xojo Open Source page, that would be nice.
PS: Even though I’ve used the Luna API framework as an example, you should be able to document API’s made with other frameworks as well with these projects. It should not be dependent on Luna to be able to generate the documentation.