Class: GrapeOAS::ApiModel::MediaType
- Defined in:
- lib/grape_oas/api_model/media_type.rb
Overview
Represents a media type (e.g., application/json) in the DTO model for OpenAPI v2/v3. Used for request bodies and responses to specify content type and schema.
Constant Summary
Constants inherited from Node
Instance Attribute Summary collapse
-
#examples ⇒ Object
Returns the value of attribute examples.
-
#extensions ⇒ Object
Returns the value of attribute extensions.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#schema ⇒ Object
Returns the value of attribute schema.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(mime_type:, schema:, examples: nil, extensions: nil) ⇒ MediaType
constructor
A new instance of MediaType.
Methods inherited from Node
Constructor Details
#initialize(mime_type:, schema:, examples: nil, extensions: nil) ⇒ MediaType
Returns a new instance of MediaType.
13 14 15 16 17 18 19 |
# File 'lib/grape_oas/api_model/media_type.rb', line 13 def initialize(mime_type:, schema:, examples: nil, extensions: nil) super() @mime_type = mime_type @schema = schema @examples = examples @extensions = extensions end |
Instance Attribute Details
#examples ⇒ Object
Returns the value of attribute examples.
11 12 13 |
# File 'lib/grape_oas/api_model/media_type.rb', line 11 def examples @examples end |
#extensions ⇒ Object
Returns the value of attribute extensions.
11 12 13 |
# File 'lib/grape_oas/api_model/media_type.rb', line 11 def extensions @extensions end |
#mime_type ⇒ Object
Returns the value of attribute mime_type.
11 12 13 |
# File 'lib/grape_oas/api_model/media_type.rb', line 11 def mime_type @mime_type end |
#schema ⇒ Object
Returns the value of attribute schema.
11 12 13 |
# File 'lib/grape_oas/api_model/media_type.rb', line 11 def schema @schema end |