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

Register json middleware #1331

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/faraday/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def to_env(connection)

require 'faraday/request/authorization'
require 'faraday/request/instrumentation'
require 'faraday/request/json'
require 'faraday/request/multipart'
require 'faraday/request/retry'
require 'faraday/request/url_encoded'
2 changes: 2 additions & 0 deletions lib/faraday/request/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ def request_type(env)
end
end
end

Faraday::Request.register_middleware(json: Faraday::Request::Json)
1 change: 1 addition & 0 deletions lib/faraday/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ def apply_request(request_env)
end
end

require 'faraday/response/json'
require 'faraday/response/logger'
require 'faraday/response/raise_error'
2 changes: 2 additions & 0 deletions lib/faraday/response/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ def response_type(env)
end
end
end

Faraday::Response.register_middleware(json: Faraday::Response::Json)