OpenAPI documentation coverage check for Rails Routes.
MIT License
See OpenAPI documentation coverage report for Rails Routes.
Add this line to your application's Gemfile:
gem "swagcov"
Execute:
bundle
Create a .swagcov.yml
in root of your Rails application.
Add the paths of your openapi
yml files (required):
docs:
paths:
- swagger.yaml
Add only
routes (optional) :
routes:
paths:
only:
- ^/v1
Add ignore
routes (optional) :
routes:
paths:
ignore:
- /v1/foobar/:token
Full Example .swagcov.yml
Config File:
docs:
paths:
- swagger.yaml
routes:
paths:
only:
- ^/v1
ignore:
- /v1/foobar/:token
Execute:
bundle exec rake swagcov
bundle exec rake swagcov
from the root of your Rails Application:All Routes (minimal configuration):
docs:
paths:
- swagger.yaml
With only
endpoint configuration:
docs:
paths:
- swagger.yaml
routes:
paths:
only:
- ^/v2
With ignore
and only
endpoint configurations:
docs:
paths:
- swagger.yaml
routes:
paths:
only:
- ^/v2
ignore:
- /v2/users
git clone [email protected]:smridge/swagcov.git
Add this line to your application's Gemfile:
# Use the relative path from your application, to the swagcov folder
gem "swagcov", path: "../swagcov"
bundle
Run Tests
bundle exec rspec spec --exclude-pattern spec/sandbox_**/**/*_spec.rb
spec
directory
cd spec/sandbox_5_2/
.ruby-version
filebundle install
bundle exec rspec spec
bundle exec rake swagcov
Note: Publishing a new version of this gem is only meant for maintainers.
VERSION
.bundle update
for each sandbox application to reflect new swagcov version in each Gemfile.lock
main
.main
on your machine.rake release
CONTRIBUTING.md
To @lonelyelk for initial development!