Class: Apia::OpenApi::Objects::BearerSecurityScheme
- Inherits:
-
Object
- Object
- Apia::OpenApi::Objects::BearerSecurityScheme
- Includes:
- Helpers
- Defined in:
- lib/apia/open_api/objects/bearer_security_scheme.rb
Instance Method Summary collapse
- #add_to_spec ⇒ Object
-
#initialize(spec:, authenticator:) ⇒ BearerSecurityScheme
constructor
A new instance of BearerSecurityScheme.
Methods included from Helpers
#add_to_components_schemas, #convert_type_to_open_api_data_type, #formatted_description, #generate_array_schema, #generate_id_from_definition, #generate_scalar_schema, #generate_schema_ref
Constructor Details
#initialize(spec:, authenticator:) ⇒ BearerSecurityScheme
Returns a new instance of BearerSecurityScheme.
26 27 28 29 |
# File 'lib/apia/open_api/objects/bearer_security_scheme.rb', line 26 def initialize(spec:, authenticator:) @spec = spec @authenticator = authenticator end |
Instance Method Details
#add_to_spec ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/apia/open_api/objects/bearer_security_scheme.rb', line 31 def add_to_spec @spec[:components][:securitySchemes] ||= {} @spec[:components][:securitySchemes][generate_id_from_definition(@authenticator.definition)] = { scheme: "bearer", type: "http" } @spec[:security] << { generate_id_from_definition(@authenticator.definition) => [] } end |