Class: OpenAPIParser::Schemas::Operation

Inherits:
Base
  • Object
show all
Includes:
ParameterValidatable
Defined in:
lib/openapi_parser/schemas/classes.rb,
lib/openapi_parser/schemas/operation.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#object_reference, #parent, #raw_schema, #root

Instance Method Summary collapse

Methods included from ParameterValidatable

#validate_path_params, #validate_request_parameter

Methods inherited from Base

#after_init, #initialize, #inspect

Methods included from Expandable

#expand_reference

Methods included from Findable

#find_object, #purge_object_cache

Methods included from Parser

#_openapi_all_child_objects, #_update_child_object, included, #load_data

Constructor Details

This class inherits a constructor from OpenAPIParser::Schemas::Base

Instance Attribute Details

#request_bodyOpenAPIParser::Schemas::RequestBody? (readonly)

Return OpenAPI3 object

Returns:



18
# File 'lib/openapi_parser/schemas/operation.rb', line 18

openapi_attr_object :request_body, RequestBody, reference: true, schema_key: :requestBody

#responsesOpenAPIParser::Schemas::Responses? (readonly)

Return OpenAPI3 object

Returns:



22
# File 'lib/openapi_parser/schemas/operation.rb', line 22

openapi_attr_object :responses, Responses, reference: false

Instance Method Details

#validate_request_body(content_type, params, options) ⇒ Object



24
25
26
# File 'lib/openapi_parser/schemas/operation.rb', line 24

def validate_request_body(content_type, params, options)
  request_body&.validate_request_body(content_type, params, options)
end

#validate_response(response_body, response_validate_options) ⇒ Object



30
31
32
# File 'lib/openapi_parser/schemas/operation.rb', line 30

def validate_response(response_body, response_validate_options)
  responses&.validate(response_body, response_validate_options)
end