     end
   end
 
+  @doc """
+  This function returns `true` for a valid format type, `false` otherwise.
+  This function can be used in guards.
+  """
   @spec supports(format) :: boolean
   defguard supports(format) when format in @formats
 
+  @doc """
+  Checks if the value matches the given type.
+  """
   @spec is?(format, any) :: boolean
   for fmt <- @formats do
     def is?(unquote(fmt), string) do

    Regex.match?(regex, string)
  end

  @spec is_uri?(any) :: boolean
  def is_uri?(string) when is_binary(string), do: is_uri?(URI.parse(string))



  def is_uri_userinfo?(_), do: false

  @doc """
  Checks if the value is a valid uri path.

  See also `Xema.Format.is_uri?/1`.
  """
  @spec is_uri_path?(any) :: boolean
  def is_uri_path?(string) when is_binary(string) do
    regex = ~r/
