mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
Adds to swagger_Formatter to remove injected body parameters since those are 2.0 and ont 3.0 compliant Adds to example_group_helpers to only automatically save request examples in the swagger output on 2xx response, since otherwise it was getting clobbered
19 lines
709 B
Ruby
19 lines
709 B
Ruby
require 'rspec/core/rake_task'
|
|
|
|
namespace :rswag do
|
|
namespace :specs do
|
|
|
|
desc 'Generate Swagger JSON files from integration specs'
|
|
RSpec::Core::RakeTask.new('swaggerize') do |t|
|
|
t.pattern = 'spec/requests/**/*_spec.rb, spec/api/**/*_spec.rb, spec/integration/**/*_spec.rb'
|
|
# TODO: fix this, as dry-run is always true despite what is in the config
|
|
# NOTE: rspec 2.x support
|
|
if Rswag::Specs::RSPEC_VERSION > 2 && Rswag::Specs.config.swagger_dry_run
|
|
t.rspec_opts = [ '--format Rswag::Specs::SwaggerFormatter', '--dry-run', '--order defined' ]
|
|
else
|
|
t.rspec_opts = [ '--format Rswag::Specs::SwaggerFormatter', '--order defined' ]
|
|
end
|
|
end
|
|
end
|
|
end
|