ueberauth/ueberauth_twitter

Ensuring can use library with Jason

snewcomer opened this issue · 4 comments

Currently, without Poison installed, decoding the response will fail. With the introduction of Jason, we could allow the consumer to specify their own json parser. What do you think? If you agree, I'll put up a small PR.

One idea I have via a config option:

config :ueberauth_twitter, json_library: Jason

@snewcomer I think this is a good idea and should be supported not just by this strategy but all of them. What do you think about that?

@hassox / @yordis we've talked about this a little, want to weigh in?

@doomspork this will be an issue, the best we do is exactly what @snewcomer propose.

Do we want to read the encoder from Ueberauth instead of the strategies?

If we add this to every single strategy will be hard to maintain for us, also for the end users since they would need to change it per strategy.

I would prefer to put json_library/0 in Ueberauth package and use it from the strategies. But I understand that it is a tradeoff since some people could ask for changing it only in specific strategies but at that moment I think they are not doing the right thing.

Yep

json_body = Ueberauth.json_library().decode!(response.body)