CrapiDocs generates API documentation automagically using your tests. It requires zero annotations, declarations or custom comments. Simply add the below code to your tests and the documentation will appear before your eyes (don't forget to run your tests first).
In spec_helper.rb
(or somewhere else) add:
require 'crapidocs'
CrapiDocs.start path_filter # See below note
Note: path_filter
is a regular expression which tells CrapiDocs which paths should be
included in the generated docs. Examples: %r{/}
, %r{/api/v1}
, etc.
That's it! A doc/api.md
file will be generated after your tests complete!
- Generates pretty good quality API documentation for
Rack::Test
-based tests - Specify a custom URI path pattern to capture only relevant endpoints
- Merges request parameters from multiple tests to determine parameter options
- Replaces numeric IDs with readible names derived from context
- Works with ParallelTests!
Check out the examples directory for example output and working tests.