Fix double stringification of context map keys

This commit is contained in:
Marcel Otto 2022-04-22 03:28:48 +02:00
parent 9655d63885
commit ad4ad5cc9d

View file

@ -101,11 +101,8 @@ defmodule JSON.LD do
|> do_context(options) |> do_context(options)
end end
defp do_context(%{"@context" => _} = object, options), defp do_context(%{"@context" => _} = object, options), do: Context.create(object, options)
do: Context.create(object, options) defp do_context(context, options), do: Context.create(%{"@context" => context}, options)
defp do_context(context, options),
do: Context.create(%{"@context" => stringify_keys(context)}, options)
defp stringify_keys(map) when is_map(map) do defp stringify_keys(map) when is_map(map) do
Map.new(map, fn Map.new(map, fn