Rswag
OpenAPI docs generated from your request specs, served from your app
No ratings yet
- Gem
- rswag
- Repository
- rswag/rswag
- License
- MIT
- Stars
- 2,200
- Added
- July 21, 2026
About
Rswag turns your RSpec request specs into an OpenAPI document and mounts Swagger UI
to render it.
What you get
- A Swagger-flavoured DSL inside request specs
- An OpenAPI file generated from specs that actually ran
- Swagger UI mounted in your app
- Documentation that cannot drift from the API, because the tests fail first
Mounting it
ruby
# Gemfile
gem "rswag-api"
gem "rswag-ui"
group :development, :test do
gem "rswag-specs"
end
# config/routes.rb
mount Rswag::Ui::Engine => "/api-docs"
mount Rswag::Api::Engine => "/api-docs"
The drift argument
Hosted API documentation is a copy of the truth, updated by hand. This one is
generated by a test run, so a change that breaks the docs breaks the build.
Discussion (0)
Sign in to join the discussion.
No comments yet.