Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate creation of REST API docs #444

Closed
mountaindude opened this issue May 14, 2022 · 0 comments · Fixed by #450
Closed

Automate creation of REST API docs #444

mountaindude opened this issue May 14, 2022 · 0 comments · Fixed by #450

Comments

@mountaindude
Copy link
Collaborator

mountaindude commented May 14, 2022

  • Do this as part of build/CI process.
  • Use a concept like this
    • Start Butler from within CI script (npm run butler-barebones) using a hidden command line option that forces dynamic Fastify-Swagger to be used, creating API docs from the defined routes.
    • Wait a few seconds for Butler to start up (sleep 10)
    • Download API spec from Fastify Swagger ui (curl localhost:<port>/documentation/yaml > api_doc/butler-api.yaml and curl localhost:<port>/documentation/json > api_doc/butler-api.json
    • Stop Butler (`pkill -f '....')
    • Generate static ReDoc html file that can be included in the repo and linked to from Butler doc site

Several challenges to solve:

  • New command line option for selecting dynamic (rather than static) Fastify Swagger mode.
  • How can Butler be started without access to certs etc? Using a special everything-is-disabled, barebones Butler config file?
  • Can files generated during the CI workflow be included in the GitHub release? Should be ok, needs testing though.
  • Can the static html ReDoc file be linked to from the butler doc site's left-side menu? If not it can always be linked to from a page on the doc site.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant