lostisland / faraday

Simple, but flexible HTTP client library, with support for multiple backends.

Home Page:https://lostisland.github.io/faraday

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configurable JSON backend

kirillkaiumov opened this issue · comments

Currently faraday provides a middleware to encode/decode JSON payloads. Internally it uses json that from the Ruby's standard library. If I want to use another JSON backend like oj then I need to implement my own middleware. So, I have a few questions:

  1. Do you think it's a good idea to allow configuring the built-in middleware to work with different JSON backends?
  2. If I want to make my own middleware to use oj, can I make it inherit from Faraday::Response::Json class? Or it's considered "private" and better to inherit from Faraday::Middleware?

Thanks!