Class: Swagger::Blocks::Nodes::RequestBodyNode

Inherits:
Swagger::Blocks::Node show all
Defined in:
lib/swagger/blocks/nodes/request_body_node.rb

Constant Summary

Constants inherited from Swagger::Blocks::Node

Swagger::Blocks::Node::VERSION_2, Swagger::Blocks::Node::VERSION_3

Instance Attribute Summary

Attributes inherited from Swagger::Blocks::Node

#name, #version

Instance Method Summary collapse

Methods inherited from Swagger::Blocks::Node

#as_json, call, #data, #is_openapi_3_0?, #is_swagger_2_0?, #key, #keys, #ref?, #static_ref?, #value_as_json

Instance Method Details

#content(type, inline_keys = nil, &block) ⇒ Object



5
6
7
8
# File 'lib/swagger/blocks/nodes/request_body_node.rb', line 5

def content(type, inline_keys = nil, &block)
  self.data[:content] ||= {}
  self.data[:content][type] = Swagger::Blocks::Nodes::ContentNode.call(version: version, inline_keys: inline_keys, &block)
end