Authorization header issue before initialize `SwaggerUI`
Bug Description:
Consider this code block:
This code block going to initialize SwaggerUi.
But To initialize SwaggerUi we need to have authorization header. And the inside onComplete we are adding Authorization Header by calling addApiKeyAuthorization().
So, initialization of SwaggerUi fails and triggers onFaiulre :p
And this resolution is to add header before initialize SwaggerUI
Some discussions:
- https://groups.google.com/forum/#!topic/swagger-swaggersocket/tJ0YHdTnBRk
- https://github.com/swagger-api/swagger-ui/issues/1171#issuecomment-100374999
| 1 Warning | |
|---|---|
| :warning: | Unless you’re refactoring existing code, please update CHANGELOG.md. |
| 1 Message | |
|---|---|
| :book: | We really appreciate pull requests that demonstrate issues, even without a fix. That said, the next step is to try and fix the failing tests! |
Here's an example of a CHANGELOG.md entry:
* [#73](https://github.com/ruby-grape/grape-swagger-rails/pull/73): Authorization header issue before initialize `SwaggerUI` - [@mur-wtag](https://github.com/mur-wtag).
Generated by :no_entry_sign: danger
Do you think you can write a test that actually reproduces this?
@mur-wtag I think the idea was to create a capybara/selenium spec that with will fail unless your fix is available. See https://github.com/ruby-grape/grape-swagger-rails/blob/master/spec/features/swagger_spec.rb to find spec samples
+1 @serggl, right now these specs pass, so make a spec that fails, apply a fix and see it succeed