You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rake task rswag:specs:swaggerize checks Rswag::Specs.config.rswag_dry_run to determine if --dry-run should be used.
However, if Im not mistaken, this check happens before an application's test/RSpec configuration has even been parsed so all the Rswag configuration values that are proxied from RSpec configuration will always be nil.
Steps to Test or Reproduce
Follow docs and add to test.rb:
RSpec.configure do |config|
config.rswag_dry_run = false
end
Run rake task, notice that it is not observed as test.rb is not loaded till later.
Expected behavior
Documentation implies I should expect to not run a dry run, but rswag_dry_run is always nil at the point of the check
@perfetti right sorry, you are correct in the case of the main branch, but this config has been renamed in v3 (see #574). I've been working off that branch for a while now and completely forgot it had a different name before!
I believe the problem still stands, even with the v2 naming. I will double check when I get a second and update this issue.
I assume the problem is as described, that setting this value in your swagger/openapi spec helper wont help as that wont be evaluated yet at the point the rake task is running
Describe the bug
The rake task
rswag:specs:swaggerize
checksRswag::Specs.config.rswag_dry_run
to determine if--dry-run
should be used.However, if Im not mistaken, this check happens before an application's test/RSpec configuration has even been parsed so all the Rswag configuration values that are proxied from RSpec configuration will always be nil.
Steps to Test or Reproduce
Follow docs and add to
test.rb
:Run rake task, notice that it is not observed as
test.rb
is not loaded till later.Expected behavior
Documentation implies I should expect to not run a dry run, but
rswag_dry_run
is always nil at the point of the checkScreenshots
Eg adding a couple of log lines:
Additional context
Add any other context about the problem here.
Dependency versions
The version of are you using for:
The text was updated successfully, but these errors were encountered: