Class: GrapeOAS::ApiModel::Parameter

Inherits:
Node
  • Object
show all
Defined in:
lib/grape_oas/api_model/parameter.rb

Overview

Represents an operation parameter in the DTO model for OpenAPI v2/v3. Used for query, path, header, and cookie parameters in both OpenAPI versions.

Constant Summary

Constants inherited from Node

Node::BUCKET_NAMES

Instance Attribute Summary collapse

Attributes inherited from Node

#id

Instance Method Summary collapse

Methods inherited from Node

bucket, #ref

Constructor Details

#initialize(location:, name:, schema:, required: false, description: nil, collection_format: nil, style: nil, explode: nil) ⇒ Parameter

Returns a new instance of Parameter.



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/grape_oas/api_model/parameter.rb', line 13

def initialize(location:, name:, schema:, required: false, description: nil, collection_format: nil, style: nil,
               explode: nil)
  super()
  @location = location.to_s
  @name = name
  @required = required
  @schema = schema
  @description = description
  @collection_format = collection_format
  @style = style&.to_s
  @explode = explode
end

Instance Attribute Details

#collection_formatObject

Returns the value of attribute collection_format.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def collection_format
  @collection_format
end

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def description
  @description
end

#explodeObject

Returns the value of attribute explode.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def explode
  @explode
end

#locationObject

Returns the value of attribute location.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def location
  @location
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def name
  @name
end

#requiredObject

Returns the value of attribute required.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def required
  @required
end

#schemaObject

Returns the value of attribute schema.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def schema
  @schema
end

#styleObject

Returns the value of attribute style.



11
12
13
# File 'lib/grape_oas/api_model/parameter.rb', line 11

def style
  @style
end