Class: Jsapi::Meta::SecurityScheme::HTTP::Other

Inherits:
Base show all
Includes:
OpenAPI::Extensions
Defined in:
lib/jsapi/meta/security_scheme/http/other.rb

Overview

Specifies a security scheme based on any other HTTP authentication than basic and bearer.

Note that OpenAPI 2.0 supports HTTP basic authentication only. Thus, a security scheme of this class is skipped when generating an OpenAPI 2.0 document.

Constant Summary

Constants included from Model::Attributes

Model::Attributes::DEFAULT_ARRAY, Model::Attributes::DEFAULT_HASH

Instance Method Summary collapse

Methods included from OpenAPI::Extensions

included

Methods inherited from Base

#deprecated, #description

Methods inherited from Model::Base

#initialize, #inspect, #merge!, #reference?, #resolve

Methods included from Model::Attributes

#attribute, #attribute_names

Constructor Details

This class inherits a constructor from Jsapi::Meta::Model::Base

Instance Method Details

#schemeObject

:attr: scheme The mandatory HTTP authentication scheme.



18
# File 'lib/jsapi/meta/security_scheme/http/other.rb', line 18

attribute :scheme, String

#to_openapi(version) ⇒ Object

Returns a hash representing the OpenAPI security scheme object, or nil if version is less than OpenAPI 3.0.



22
23
24
25
26
27
28
29
# File 'lib/jsapi/meta/security_scheme/http/other.rb', line 22

def to_openapi(version, *)
  version = OpenAPI::Version.from(version)
  return if version < OpenAPI::V3_0

  with_openapi_extensions(
    base_openapi_fields('http', version).merge(scheme: scheme)
  )
end