code: def min_max(obj, val, is_max):
      
      n = getattr(obj, 'maximum' if is_max else 'minimum', None)
      if n == None:
          return
  
      _eq = getattr(obj, 'exclusiveMaximum' if is_max else 'exclusiveMinimum', False)
      if is_max:
          to_raise = val >= n if _eq else val > n
      else:
          to_raise = val <= n if _eq else val < n
  
      if to_raise:
          raise ValidationError('condition failed: {0}, v:{1} compared to o:{2}'.format('maximum' if is_max else 'minimum', val, n))
docs: min/max validator for float and integer