Class: Swagger::Blocks::ResourceListingAuthorizationNode
- Defined in:
- lib/swagger/blocks.rb
Overview
v1.2: NOTE: in the spec this is different than API Declaration authorization. v1.2: goo.gl/PvwUXj#515-authorization-object
Constant Summary collapse
- GRANT_TYPES =
[:implicit, :authorization_code].freeze
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
Methods inherited from Node
#as_json, call, #data, #is_swagger_1_2?, #is_swagger_2_0?, #key, #keys
Instance Method Details
#grant_type(name, inline_keys = nil, &block) ⇒ Object
378 379 380 381 382 383 384 |
# File 'lib/swagger/blocks.rb', line 378 def grant_type(name, inline_keys = nil, &block) raise ArgumentError.new("#{name} not in #{GRANT_TYPES}") if !GRANT_TYPES.include?(name) self.data[:grantTypes] ||= Swagger::Blocks::GrantTypesNode.new self.data[:grantTypes].version = version self.data[:grantTypes].implicit(inline_keys, &block) if name == :implicit self.data[:grantTypes].(inline_keys, &block) if name == :authorization_code end |