     [msg <> at_path(path) | acc]
   end
 
-  defp format_error(%{minimum: minimum, value: value}, path, acc) when not is_nil(minimum) do
+  defp format_error(%{minimum: minimum, value: value}, path, acc) do
     msg = "Value #{inspect(value)} is less than minimum value of #{inspect(minimum)}"
     [msg <> at_path(path) | acc]
   end
 
   defp format_error(%{maximum: maximum, exclusive_maximum: true, value: value}, path, acc)
        when maximum == value do
+    # The guard is used to match values of different types (integer, float).
     msg = "Value #{inspect(value)} equals exclusive maximum value of #{inspect(maximum)}"
     [msg <> at_path(path) | acc]
   end


  defp format_error(%{minimum: minimum, exclusive_minimum: true, value: value}, path, acc)
       when minimum == value do
    msg = "Value #{inspect(value)} equals exclusive minimum value of #{inspect(minimum)}"
    [msg <> at_path(path) | acc]
  end

    [msg <> at_path(path) | acc]
  end

  defp format_error(%{enum: _enum, value: value}, path, acc) do
    msg = "Value #{inspect(value)} is not defined in enum"
    [msg <> at_path(path) | acc]
  end

  defp format_error(%{keys: keys, value: value}, path, acc) do
    msg = "Expected #{inspect(keys)} as key, got #{inspect(value)}"
    [msg <> at_path(path) | acc]
  end

  defp format_error(%{min_properties: min, value: value}, path, acc) do
    msg = "Expected at least #{inspect(min)} properties, got #{inspect(value)}"
    [msg <> at_path(path) | acc]
  end

  defp format_error(%{max_properties: max, value: value}, path, acc) do
    msg = "Expected at most #{inspect(max)} properties, got #{inspect(value)}"
    [msg <> at_path(path) | acc]
  end
