DEV Community

Melita Kokot
Melita Kokot

Posted on

Automatically generate API documentation from RSpec tests

Manual documentation maintenance can be time-consuming and error-prone, and nobody likes to do it. Due to human error, things are often overlooked, forgotten or accidentally replaced. Most developers were involved in unnecessary debugging sessions because API was changed but the documentation was not properly updated.

We've built a gem for generating documentation from RSpec tests for Rails - Dox. It uses the request/response information from your test examples and you only need to write some metadata using the Dox DSL. It generates API Blueprint formatted markdown. To see it in action, check out the demo app.

It should take you no time to plug it in your Rails/RSpec API app and start enjoying the extra time.

Read the full article on The Capsized Eight blog.

Top comments (2)

Collapse
 
amalrik profile image
Amalrik Maia

This seems great.
Does it only support rspec? Any plans to include minitest support?

Collapse
 
melcha profile image
Melita Kokot

Thanks, it only supports rspec. We don't plan to add minitest support in the near future because we don't use minitest, but contributions are welcome 🙂