Class: OpenapiFirst::Definition::Response
- Inherits:
-
Object
- Object
- OpenapiFirst::Definition::Response
- Defined in:
- lib/openapi_first/definition/response.rb
Overview
Represents a response definition in the OpenAPI document. This is not a direct reflecton of the OpenAPI 3.X response definition, but a combination of status, content type and content schema.
Instance Attribute Summary collapse
- #content_schema ⇒ Object readonly
- #content_type ⇒ Object readonly
- #operation ⇒ Object readonly
- #status ⇒ Object readonly
Instance Method Summary collapse
- #description ⇒ Object
- #headers ⇒ Object
-
#initialize(operation:, status:, response_object:, content_type:, content_schema:) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(operation:, status:, response_object:, content_type:, content_schema:) ⇒ Response
Returns a new instance of Response.
9 10 11 12 13 14 15 |
# File 'lib/openapi_first/definition/response.rb', line 9 def initialize(operation:, status:, response_object:, content_type:, content_schema:) @operation = operation @response_object = response_object @status = status @content_type = content_type @content_schema = content_schema end |
Instance Attribute Details
#content_schema ⇒ Object (readonly)
21 22 23 |
# File 'lib/openapi_first/definition/response.rb', line 21 def content_schema @content_schema end |
#content_type ⇒ Object (readonly)
21 22 23 |
# File 'lib/openapi_first/definition/response.rb', line 21 def content_type @content_type end |
#operation ⇒ Object (readonly)
21 22 23 |
# File 'lib/openapi_first/definition/response.rb', line 21 def operation @operation end |
#status ⇒ Object (readonly)
21 22 23 |
# File 'lib/openapi_first/definition/response.rb', line 21 def status @status end |
Instance Method Details
#description ⇒ Object
27 28 29 |
# File 'lib/openapi_first/definition/response.rb', line 27 def description @response_object['description'] end |
#headers ⇒ Object
23 24 25 |
# File 'lib/openapi_first/definition/response.rb', line 23 def headers @response_object['headers'] end |