require "json" class Kek class JSONParser < Faraday::Middleware def initialize(app) super(app) end def call(request) @app.call(request).on_complete do |response| response[:body] = JSON.parse(response[:body], symbolize_names: true) end end end end