We had thought we changed over to jason for JSON encoding during our upgrade to Phoenix 1.4. But, we still have poison in our deps because of other libraries. Things have been working fine. Today an unrelated dep upgrade bumped poison to 4.x and we saw an error out of phoenix:
IO.warn """
Phoenix now requires you to explicitly list which engine to use
for Phoenix JSON encoding. We recommend everyone to upgrade to
Jason by setting in your config/config.exs:
config :phoenix, :json_encoding, Jason
And then adding {:jason, "~> 1.0"} as a dependency.
If instead you would rather continue using Poison, then add to
your config/config.exs:
config :phoenix, :json_encoding, Poison
"""
But the variable the case is operating on is configured_lib = Application.get_env(:phoenix, :json_library)
If I change our configuration to:
config :phoenix, :json_library, Jason
The error goes away.
I think the documentation is wrong? :json_encoding instead of :json_library? The change happened in e34c8b6e3bc3a57191097d723c5c9795c5118bf5 .
Environment
Behavior
We had thought we changed over to jason for JSON encoding during our upgrade to Phoenix 1.4. But, we still have poison in our deps because of other libraries. Things have been working fine. Today an unrelated dep upgrade bumped poison to 4.x and we saw an error out of phoenix:
We have this configured:
Which matches the recommendation at:
https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix.ex#L103-L117
But the variable the case is operating on is
configured_lib = Application.get_env(:phoenix, :json_library)
If I change our configuration to:
The error goes away.
I think the documentation is wrong?
:json_encoding
instead of:json_library
? The change happened in e34c8b6e3bc3a57191097d723c5c9795c5118bf5 .