code: def generate_type_validator(type_, **kwargs):
      
      if is_non_string_iterable(type_):
          types = tuple(type_)
      else:
          types = (type_,)
      # support x-nullable since Swagger 2.0 doesn't support null type
      # (see https://github.com/OAI/OpenAPI-Specification/issues/229)
      if kwargs.get('x-nullable', False) and NULL not in types:
          types = types + (NULL,)
      return functools.partial(validate_type, types=types)
docs: Generates a callable validator for the given type or iterable of types.