 
     %Ref{
       pointer: pointer,
-      # unless(is_nil(ptr), do: "##{ptr}"),
-      ptr: ptr,
       path: path,
       remote: remote,
       url: url

  def new(pointer) when is_binary(pointer) do
    uri = URI.parse(pointer)
    path = uri |> Map.get(:path)
    ptr = uri |> Map.get(:fragment)
    remote = !is_nil(path) && Regex.match?(~r/(?:\..+#)|(?:\..+$)/, path)

    url =

    end
  end

  defp get_x(%Ref{remote: false, path: nil, pointer: pointer}, opts) do
    with {:ok, schema} <- do_get(pointer, opts[:root]), do: {:ok, schema, opts}
  end

  defp get_x(%Ref{remote: false, path: path, pointer: nil}, opts) do
    id =
      opts[:id]
      |> URI.parse()
