   defp do_properties([{prop, schema} | props], map, errors) do
     with {:ok, value} <- get_value(map, prop),
          :ok <- do_property(schema, value) do
-      do_properties(props, Map.delete(map, prop), errors)
+      do_properties(props, delete_property(map, prop), errors)
     else
       {:error, reason} ->
         do_properties(

  defp do_property(_schema, nil), do: :ok

  defp do_property(schema, value), do: Xema.validate(schema, value)

  @spec get_value(map, String.t() | atom) :: any
  defp get_value(map, key) when is_atom(key) do

  @type result :: :ok | {:error, map}

  @spec validate(Xema.t() | Xema.Schema.t(), any) :: result
  def validate(%{content: schema}, value) do
    validate(schema, value)
  end

  def validate(%{type: :any} = schema, value) do
