class OpenAPIParser::RequestOperation
binding request data and operation object
Attributes
@!attribute [r] operation_object
@return [OpenAPIParser::Schemas::Operation]
@!attribute [r] path_params
@return [Hash{String => String}]
@!attribute [r] config
@return [OpenAPIParser::Config]
@!attribute [r] http_method
@return [String]
@!attribute [r] original_path
@return [String]
@!attribute [r] path_item
@return [OpenAPIParser::Schemas::PathItem]
@!attribute [r] operation_object
@return [OpenAPIParser::Schemas::Operation]
@!attribute [r] path_params
@return [Hash{String => String}]
@!attribute [r] config
@return [OpenAPIParser::Config]
@!attribute [r] http_method
@return [String]
@!attribute [r] original_path
@return [String]
@!attribute [r] path_item
@return [OpenAPIParser::Schemas::PathItem]
@!attribute [r] operation_object
@return [OpenAPIParser::Schemas::Operation]
@!attribute [r] path_params
@return [Hash{String => String}]
@!attribute [r] config
@return [OpenAPIParser::Config]
@!attribute [r] http_method
@return [String]
@!attribute [r] original_path
@return [String]
@!attribute [r] path_item
@return [OpenAPIParser::Schemas::PathItem]
@!attribute [r] operation_object
@return [OpenAPIParser::Schemas::Operation]
@!attribute [r] path_params
@return [Hash{String => String}]
@!attribute [r] config
@return [OpenAPIParser::Config]
@!attribute [r] http_method
@return [String]
@!attribute [r] original_path
@return [String]
@!attribute [r] path_item
@return [OpenAPIParser::Schemas::PathItem]
@!attribute [r] operation_object
@return [OpenAPIParser::Schemas::Operation]
@!attribute [r] path_params
@return [Hash{String => String}]
@!attribute [r] config
@return [OpenAPIParser::Config]
@!attribute [r] http_method
@return [String]
@!attribute [r] original_path
@return [String]
@!attribute [r] path_item
@return [OpenAPIParser::Schemas::PathItem]
@!attribute [r] operation_object
@return [OpenAPIParser::Schemas::Operation]
@!attribute [r] path_params
@return [Hash{String => String}]
@!attribute [r] config
@return [OpenAPIParser::Config]
@!attribute [r] http_method
@return [String]
@!attribute [r] original_path
@return [String]
@!attribute [r] path_item
@return [OpenAPIParser::Schemas::PathItem]
Public Class Methods
@param [OpenAPIParser::Config] config @param [OpenAPIParser::PathItemFinder] path_item_finder @return [OpenAPIParser::RequestOperation, nil]
# File lib/openapi_parser/request_operation.rb, line 8 def create(http_method, request_path, path_item_finder, config) result = path_item_finder.operation_object(http_method, request_path) return nil unless result self.new(http_method, result, config) end
@param [String] http_method
@param [OpenAPIParser::PathItemFinder::Result] result @param [OpenAPIParser::Config] config
# File lib/openapi_parser/request_operation.rb, line 33 def initialize(http_method, result, config) @http_method = http_method.to_s @original_path = result.original_path @operation_object = result.operation_object @path_params = result.path_params || {} @path_item = result.path_item_object @config = config end
Public Instance Methods
# File lib/openapi_parser/request_operation.rb, line 42 def validate_path_params(options = nil) options ||= config.path_params_options operation_object&.validate_path_params(path_params, options) end
@param [String] content_type @param [Hash] params @param [OpenAPIParser::SchemaValidator::Options] options
# File lib/openapi_parser/request_operation.rb, line 50 def validate_request_body(content_type, params, options = nil) options ||= config.request_body_options operation_object&.validate_request_body(content_type, params, options) end
@param [Hash] params parameter hash @param [Hash] headers headers hash @param [OpenAPIParser::SchemaValidator::Options] options request validator options
# File lib/openapi_parser/request_operation.rb, line 66 def validate_request_parameter(params, headers, options = nil) options ||= config.request_validator_options operation_object&.validate_request_parameter(params, headers, options) end
@param [OpenAPIParser::RequestOperation::ValidatableResponseBody] response_body @param [OpenAPIParser::SchemaValidator::ResponseValidateOptions] response_validate_options
# File lib/openapi_parser/request_operation.rb, line 57 def validate_response_body(response_body, response_validate_options = nil) response_validate_options ||= config.response_validate_options operation_object&.validate_response(response_body, response_validate_options) end