diff --git a/lib/atex/lexicon/validators/string.ex b/lib/atex/lexicon/validators/string.ex index 0f8c3cb..e5a6901 100644 --- a/lib/atex/lexicon/validators/string.ex +++ b/lib/atex/lexicon/validators/string.ex @@ -53,11 +53,8 @@ defmodule Atex.Lexicon.Validators.String do do: Validators.boolean_validate(Atex.AtURI.match?(value), "should be a valid at:// URI") defp validate_option(value, {:format, "cid"}) do - # TODO: is there a regex provided by the lexicon docs/somewhere? - try do - Multiformats.CID.decode(value) - :ok - rescue + case DASL.CID.new(value) do + {:ok, _} -> :ok _ -> {:error, "should be a valid CID", []} end end