     end
   end
 
+  #
+  # Validators
+  #
+
   @spec enum(Xema.Schema.t(), any) :: result
   defp enum(%{enum: nil}, _element), do: :ok
 

         do: :ok
  end

  defp validate(:string, schema, value) do
    with length <- String.length(value),
         :ok <- min_length(schema, length, value),
         :ok <- max_length(schema, length, value),

         do: :ok
  end

  defp validate(nil, _schema, nil, _opts), do: :ok

  defp validate(nil, schema, value, _opts),
    do: {:error, %{value: value, type: schema.as}}

  defp validate(:list, schema, value, _opts) do
    with :ok <- min_items(schema, value),
         :ok <- max_items(schema, value),
         :ok <- items(schema, value),
