Method: Committee::SchemaValidator::OpenAPI3::OperationWrapper#valid_request_content_type?

Defined in:
lib/committee/schema_validator/open_api_3/operation_wrapper.rb

#valid_request_content_type?(content_type) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
62
63
64
65
66
67
# File 'lib/committee/schema_validator/open_api_3/operation_wrapper.rb', line 59

def valid_request_content_type?(content_type)
  if (request_body = request_operation.operation_object&.request_body)
    !request_body.select_media_type(content_type).nil?
  else
    # if not exist request body object, all content_type allow.
    # because request body object required content field so when it exists there're content type definition.
    true
  end
end