Class: Jsapi::Meta::OpenAPI::SecurityScheme::APIKey
- Defined in:
- lib/jsapi/meta/openapi/security_scheme/api_key.rb
Overview
Represents a security scheme based on an API key.
Instance Method Summary collapse
-
#in ⇒ Object
:attr: in The location of the API key.
-
#name ⇒ Object
:attr: name The name of the header, query parameter or cookie the API key is sent by.
-
#to_openapi ⇒ Object
Returns a hash representing the security scheme object.
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
#in ⇒ Object
:attr: in The location of the API key. Possible values are:
-
"cookie"
-
"header"
-
"query"
17 |
# File 'lib/jsapi/meta/openapi/security_scheme/api_key.rb', line 17 attribute :in, String, values: %w[cookie header query] |
#name ⇒ Object
:attr: name The name of the header, query parameter or cookie the API key is sent by.
23 |
# File 'lib/jsapi/meta/openapi/security_scheme/api_key.rb', line 23 attribute :name, String |
#to_openapi ⇒ Object
Returns a hash representing the security scheme object.
26 27 28 29 30 31 32 33 |
# File 'lib/jsapi/meta/openapi/security_scheme/api_key.rb', line 26 def to_openapi(*) { type: 'apiKey', name: name, in: self.in, description: description }.compact end |