Class: LambdaOpenApi::BodyParameter

Inherits:
Object
  • Object
show all
Defined in:
lib/lambda_open_api/body_parameter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = nil) ⇒ BodyParameter

Returns a new instance of BodyParameter.



7
8
9
# File 'lib/lambda_open_api/body_parameter.rb', line 7

def initialize(data = nil)
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/lambda_open_api/body_parameter.rb', line 5

def data
  @data
end

Instance Method Details

#jsonObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/lambda_open_api/body_parameter.rb', line 11

def json
  hash = LambdaOpenApi::BodyProperty.new
  hash.generate(@data)
  {
    "name"=> "body",
    "in"=> "body",
    "description"=> "",
    "required"=> false,
    "schema"=> {
      "description"=> "",
      "type"=> "object",
      "properties"=> hash.props,
      "required"=> []
    }
  }
end