Class: GrapeOAS::ApiModel::Parameter
- 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
Instance Attribute Summary collapse
-
#collection_format ⇒ Object
Returns the value of attribute collection_format.
-
#description ⇒ Object
Returns the value of attribute description.
-
#explode ⇒ Object
Returns the value of attribute explode.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#required ⇒ Object
Returns the value of attribute required.
-
#schema ⇒ Object
Returns the value of attribute schema.
-
#style ⇒ Object
Returns the value of attribute style.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(location:, name:, schema:, required: false, description: nil, collection_format: nil, style: nil, explode: nil) ⇒ Parameter
constructor
A new instance of Parameter.
Methods inherited from Node
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_format ⇒ Object
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 |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def description @description end |
#explode ⇒ Object
Returns the value of attribute explode.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def explode @explode end |
#location ⇒ Object
Returns the value of attribute location.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def name @name end |
#required ⇒ Object
Returns the value of attribute required.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def required @required end |
#schema ⇒ Object
Returns the value of attribute schema.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def schema @schema end |
#style ⇒ Object
Returns the value of attribute style.
11 12 13 |
# File 'lib/grape_oas/api_model/parameter.rb', line 11 def style @style end |