Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update security_scheme.cr #19

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Update security_scheme.cr #19

merged 1 commit into from
Oct 13, 2020

Conversation

grkek
Copy link
Contributor

@grkek grkek commented Oct 13, 2020

The scheme was set to basic which resulted into a basic authorization popup showing instead of a header input value, I updated the scheme and it worked by monkey patching the library.

module Swagger::Objects
  # SecurityScheme Object
  #
  # See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#componentsSecuritySchemes
  struct SecurityScheme
    def self.bearer(description : String? = nil, format : String? = nil)
      new("http", description, parameter_location: "header", scheme: "bearer", bearer_format: format)
    end
  end
end

The scheme was set to `basic` which resulted into a `basic authorization` popup showing instead of a header input value, I updated the scheme and it worked by monkey patching the library.

```ruby
module Swagger::Objects
  # SecurityScheme Object
  #
  # See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#componentsSecuritySchemes
  struct SecurityScheme
    def self.bearer(description : String? = nil, format : String? = nil)
      new("http", description, parameter_location: "header", scheme: "bearer", bearer_format: format)
    end
  end
end
```
@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Oct 13, 2020
@icyleaf icyleaf merged commit 595b994 into icyleaf:master Oct 13, 2020
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants