Rswag: Issue with Devise endpoint on an API

Created on 8 Dec 2019  路  3Comments  路  Source: rswag/rswag

While trying to test and document an endpoint on my API I have come across an issue. The documentation works flawlessly. But whenever I try to test the /signup endpoint(just run the test that is generated with the documentation) I get an error related to JWT and warden:

1) Auth API /signup post Auth Created returns a 200 response
     Failure/Error: ref = request.content_mime_type.ref

     NoMethodError:
       undefined method `ref' for nil:NilClass
       Did you mean?  def

The test is pretty simple:

response '200', 'Auth Created' do
        let(:auth) { FactoryBot.attributes_for(:auth).merge(user_attributes: FactoryBot.attributes_for(:user)) }
        schema type: :object,
               properties: {
                 data: {
                   '$ref': '#/definitions/auth_object'
                 }
               }
        run_test!
      end

I make the hash that will be sent to the endpoint, and thats it, the schema also seems to be ok since I can execute the request using the docs with 0 issue. Using postman also gives me no trouble, only when I try to run this spec I get this error, any idea what it might be?

Most helpful comment

Have the same issue with rails (6.0.1, api mode) + devise_token_auth (1.1.3) + rswag (2.2.0)

All 3 comments

You're the second person to mention this recently so I'll try whip up an OAuth/Devise/Doorkeeper example app see if there's something going on here that I've missed until now. :)

If you find it relevant, my implementation followed this article. Anyway, I'll check the other issue, maybe I'll find something aswell.

Have the same issue with rails (6.0.1, api mode) + devise_token_auth (1.1.3) + rswag (2.2.0)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcoms picture mcoms  路  4Comments

abevoelker picture abevoelker  路  4Comments

douglasrlee picture douglasrlee  路  4Comments

ManevilleF picture ManevilleF  路  4Comments

richthedev picture richthedev  路  5Comments