code: def request_with_validation(
      api: str,
      method: str,
      path_params: dict = None,
      query_params: dict = None,
      body: dict = None,
  ) -> requests.Response:
      operation: APIOperation = SCHEMA[api][method]
  
      assert isinstance(operation.schema, OpenApi30)
  
      if body:
          validate_schema(
              data=body,
              operation_schema=operation.schema,
              raw_definitions=operation.definition.raw["requestBody"][
                  "content"
              ]["application/json"]["schema"],
          )
  
      if path_params is None:
          path_params = {}
      if query_params is None:
          query_params = {}
      action = getattr(requests, method.lower(), None)
  
      for param in operation.path_parameters.items:
          if param.is_required:
              assert param.name in path_params
  
      for param in operation.query.items:
          if param.is_required:
              assert param.name in query_params
  
      for param in path_params.keys():
          assert param in set(
              p.name for p in operation.path_parameters.items
          )
  
      for param in query_params.keys():
          assert param in set(p.name for p in operation.query.items)
  
      if not action:
          raise RuntimeError(f"Method {method} does not exists")
  
      response = action(
          url=get_api_string(QDRANT_HOST, api, path_params),
          params=query_params,
          json=body,
      )
  
      operation.validate_response(response)
  
      return response
  
file_path: qdrant/openapi/tests/openapi_integration/helpers/helpers.py
imports: import jsonschema
  import requests
  from schemathesis.models import APIOperation
  from schemathesis.specs.openapi.references import ConvertingResolver
  from schemathesis.specs.openapi.schemas import OpenApi30
  from .settings import QDRANT_HOST, SCHEMA
label_desc: Use image node_id 3 for calling a global function with example usage: request_with_validation(api, method, path_params, query_params, body) and returns: response