Repository navigation
Conversation
The client parsed the response body into a model and discarded it, so there was no public way to store or log a response as received, or to read a field the models don't cover yet. raw_body is the body string before parsing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
This adds
raw_bodytoMinfraud::HTTPService::Response: the response body as the web service sent it, before parsing.The models are a good way to read a response. But a user who wants to store the response, log it, or read a field the library doesn't model yet has no public way to get the response itself. The client reads the body, parses it into a model and discards it.
raw_bodygives the response exactly as received, and leaves parsing and storage to the caller. A stored body can still become a model withMinfraud::Model::Factors.new(JSON.parse(raw_body), ['en']).It's a String rather than the
HTTP::Response, so the public API doesn't depend on the HTTP library.The successful-request example in
spec/http_spec.rbnow also checksraw_body.bundle exec rspec(263 examples) and RuboCop pass. The CHANGELOG entry is under the unreleased v2.11.0.🤖 Generated with Claude Code
Summary by CodeRabbit