Class: Jsapi::Meta::OpenAPI::SecurityScheme::HTTP::Bearer
- Defined in:
- lib/jsapi/meta/openapi/security_scheme/http/bearer.rb
Overview
Represents a security scheme based on bearer authentication.
Note that Bearer authentication was introduced with OpenAPI 3.0. Thus, a security scheme of this class is skipped when generating an OpenAPI 2.0 document.
Instance Method Summary collapse
-
#bearer_format ⇒ Object
:attr: bearer_format The optional format of the bearer token.
-
#to_openapi(version) ⇒ Object
Returns a hash representing the security scheme object, or
nil
ifversion.major
is 2.
Methods inherited from Base
Methods inherited from Base
#initialize, #inspect, #reference?, #resolve
Methods included from Attributes::ClassMethods
Constructor Details
This class inherits a constructor from Jsapi::Meta::Base
Instance Method Details
#bearer_format ⇒ Object
:attr: bearer_format The optional format of the bearer token.
17 |
# File 'lib/jsapi/meta/openapi/security_scheme/http/bearer.rb', line 17 attribute :bearer_format, String |
#to_openapi(version) ⇒ Object
Returns a hash representing the security scheme object, or nil
if version.major
is 2.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/jsapi/meta/openapi/security_scheme/http/bearer.rb', line 21 def to_openapi(version) version = OpenAPI::Version.from(version) return if version.major == 2 { type: 'http', scheme: 'bearer', bearerFormat: bearer_format, description: description }.compact end |