Open stevegeek opened 1 year ago
That config variable is supposed to be swagger_dry_run
not rswag_dry_run
that's probably your problem.
If you check this, you can see you've got the variable name wrong..
@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!
See:
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
@stevegeek, see https://github.com/rswag/rswag/issues/359#issuecomment-728836401
@romanblanco ok thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If the issue is still relevant to you, please leave a comment stating so to keep the issue from being closed. Thank you for your contributions.
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: