Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Poison outside tests #127

Closed
wants to merge 1 commit into from
Closed

Conversation

jayjun
Copy link

@jayjun jayjun commented Dec 28, 2018

If no serializers are set, OAuth2.Serializer defaults to using Poison.

# mix.exs
def application do
  [applications: [:logger, :hackney],
   env: [serializers: %{"application/json" => Poison}]]
end

This makes Poison a required runtime dependency.

I bumped into this issue after replacing Poison with Jason and running mix deps.clean --unused. Without the explicit requirement, Poison is removed even when code relies on it.

@scrogson
Copy link
Member

Hi @jayjun I'm currently working on getting #92 merged and a new release. Serializer registration will no longer be automatic but need to be explicitly registered in the client struct instance.

@scrogson scrogson closed this Dec 28, 2018
@scrogson
Copy link
Member

To get around the issue you are experiencing here (in the current version), you'll just need to override the defaults with:

config :oauth2,
  serializers: %{"application/json" => Jason}

@jayjun jayjun deleted the poison branch December 29, 2018 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants