On this page
Overview
Rswag extends rspec-rails request specs with an OpenAPI-based DSL so API behavior testing and documentation can share the same source. rswag-specs validates requests and responses and generates OpenAPI JSON or YAML, while rswag-api and rswag-ui expose the specification and Swagger UI from the Rails application.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Describe and execute request specs as an OpenAPI DSL
Define paths, HTTP methods, parameters, responses, and schemas as RSpec examples, then use run_test! to send real requests and validate status codes and response bodies.
Sources: [2]
Best fit
Fits Rails APIs that want integration tests and consumer-facing API documentation to share one definition
It is useful for Rails APIs already using RSpec request specs when teams want to reduce duplicated test and documentation definitions and include response-schema validation in the same workflow.
Sources: [2]
Before adoption
Treat spec edits as API-contract changes when generated documents are public
Because the test DSL is also the documentation source, changes to parameters or response schemas can affect both tests and the consumer-facing contract. Review them with API compatibility in mind.
Sources: [2]
Check the 2.17.0 dependency range and maintainer status
In 2.17.0, rswag-specs allows Rails-related dependencies from 5.2 up to but not including 8.2, and the release adds Rails 8.1 support. The README also says the project is seeking maintainers, so long-term adoption should consider issue and release cadence.
Official sources
- [1]rswag/rswag repository(2026-09-30)
- [2]Rswag 2.17.0 README(2026-09-30)
- [3]Rswag 2.17.0 gemspec(2026-09-30)
- [4]Rswag Specs 2.17.0 gemspec(2026-09-30)
- [5]Rswag 2.17.0 release(2026-09-30)
- [6]Rswag MIT license(2026-09-30)
Supplemental curator note
Sharing one definition between API tests and OpenAPI documentation can reduce duplication in Rails APIs. Because spec edits can also change the public contract, review them for API compatibility rather than only test correctness.
Try it in 3 steps
- 1
Install Rswag 2.17.0
Add the stable Rswag release to an existing Rails application.
bundle add rswag --version 2.17.0 - 2
Generate the Rswag setup
Create the OpenAPI helper, API endpoint, Swagger UI, and related initial configuration.
rails g rswag:install - 3
Generate the OpenAPI document
After defining and running request specs, generate OpenAPI JSON or YAML from their metadata.
bundle exec rake rswag:specs:swaggerize
Growth
Growth trends · Last 30 days
2,202 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- openapi
- rswag
- swagger-ui
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Firecrawl186,787 Stars
1 shared tag(s) · 1 shared category(s)
a web context API for search, scraping, crawling, and browser interaction
TypeScript - Axios109,248 Stars
1 shared tag(s) · 1 shared category(s)
Share interceptors, adapters, timeouts, and cancellation across browser and Node.js HTTP requests
JavaScript - Playwright96,900 Stars
1 shared tag(s) · 1 shared category(s)
Drive Chromium, Firefox, and WebKit through one API and test runner for E2E, scripting, and agent browser automation
TypeScript - Flask74,803 Stars
1 shared tag(s) · 1 shared category(s)
build Python WSGI applications with routing, request handling, and Jinja templates
Python - Jest45,464 Stars
1 shared tag(s) · 1 shared category(s)
Combine assertions, mocks, watch mode, snapshots, coverage, and worker isolation in one JavaScript test runner
TypeScript - Kong Gateway44,224 Stars
1 shared tag(s) · 1 shared category(s)
Centralize API routing, authentication, and traffic control at a shared gateway
Lua
Report incorrect information
Tell us if any listing information is incorrect or outdated.