icyleaf / swagger

Swagger contains a OpenAPI / Swagger universal documentation generator and HTTP server handler.
MIT License
41 stars 10 forks source link

Update security_scheme.cr #19

Closed grkek closed 4 years ago

grkek commented 4 years ago

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