Class: LambdaOpenApi::PathParameter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil) ⇒ PathParameter

Returns a new instance of PathParameter.



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

def initialize(name: nil)
  @name = name
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/lambda_open_api/path_parameter.rb', line 3

def description
  @description
end

#inObject

Returns the value of attribute in.



3
4
5
# File 'lib/lambda_open_api/path_parameter.rb', line 3

def in
  @in
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/lambda_open_api/path_parameter.rb', line 3

def name
  @name
end

#requiredObject

Returns the value of attribute required.



3
4
5
# File 'lib/lambda_open_api/path_parameter.rb', line 3

def required
  @required
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/lambda_open_api/path_parameter.rb', line 3

def type
  @type
end

Instance Method Details

#jsonObject



9
10
11
12
13
14
15
16
17
# File 'lib/lambda_open_api/path_parameter.rb', line 9

def json
  {
    "name"=> @name || "id",
    "in"=> @in || "path",
    "description"=> @description || "",
    "required"=> @required || true,
    "type"=> @type || "integer"
  }
end