ruby-on-railsrspecruby-on-rails-5rspec-railsrswag

rswag rails gem, does not recognize my pattern for create swagger.yml


 example : 
rake rswag:specs:swaggerize PATTERN="spec/controllers/api/v1/admin/\*"

or: 

rake rswag:specs:swaggerize pattern="spec/controllers/api/v1/admin/authentications_controller_spec.rb"

or : 
rake rswag:specs:swaggerize pattern="spec/controllers/api/v1/\**/\*_spec.rb"

by considering the above code, the swagger.YAML file generates empty. so how I must use a pattern?


Solution

  • I think you should use the master branch.

    gem 'rswag', github: 'rswag/rswag', branch: 'master'
    

    then

    rake rswag:specs:swaggerize PATTERN="spec/controllers/**/*_spec.rb"
    

    Hope it works as expected ;)