Skip to content

Add raw GET methods for unparsed Kill Bill responses#118

Open
tungleduyxyz wants to merge 1 commit into
masterfrom
kaui_6.17
Open

Add raw GET methods for unparsed Kill Bill responses#118
tungleduyxyz wants to merge 1 commit into
masterfrom
kaui_6.17

Conversation

@tungleduyxyz

@tungleduyxyz tungleduyxyz commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Related : killbill/killbill-admin-ui#611

Summary

  • Add Resource.raw_get to fetch endpoints and return the raw response body without model parsing
  • Add Subscription.find_raw_by_id as a raw-response counterpart to find_by_id
  • Cover both methods with specs verifying body passthrough, default args, error propagation, and that no model instantiation occurs

Test plan

  • bundle exec rspec spec/killbill_client/raw_response_spec.rb

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds an API surface to fetch Kill Bill endpoints while returning the raw (unparsed) response body, enabling callers to bypass JSON-to-model parsing when needed.

Changes:

  • Add KillBillClient::Model::Resource.raw_get to return response.body directly from KillBillClient::API.get.
  • Add KillBillClient::Model::Subscription.find_raw_by_id as a raw-body counterpart to find_by_id.
  • Add RSpec coverage validating passthrough behavior, default arguments, and that model parsing is not invoked.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
spec/killbill_client/raw_response_spec.rb Adds specs for Resource.raw_get and Subscription.find_raw_by_id raw-body behavior and error propagation.
lib/killbill_client/models/subscription.rb Adds Subscription.find_raw_by_id which delegates to raw_get and returns the raw response body.
lib/killbill_client/models/resource.rb Adds Resource.raw_get that performs a GET and returns response.body without parsing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +41
api_response = double('Net::HTTPResponse', :body => '{"className":"NoSuchElementException"}')
response_error = KillBillClient::API::ResponseError.new(api_response, 404)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants