PAT-1866 Return the response from ApiClient::sendRequest()#526
Closed
pepamartinec wants to merge 1 commit into
Closed
PAT-1866 Return the response from ApiClient::sendRequest()#526pepamartinec wants to merge 1 commit into
pepamartinec wants to merge 1 commit into
Conversation
sendRequest() previously returned void and discarded the response. Return the ResponseInterface (a backward-compatible widening) so callers can decode the raw body themselves -- e.g. clients whose payloads must preserve the JSON object/array distinction -- without going through the array-based sendRequestAndMapResponse(). Now that sendRequest() returns the response, the private doSendRequest() was a redundant indirection: fold it into sendRequest(), which gains the optional per-request $options (already public via sendRequestAndMapResponse).
dad6940 to
5093d3a
Compare
Contributor
Author
|
Folded into #524 — the base-client change ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes
https://linear.app/keboola/issue/PAT-1866
ApiClient::sendRequest()previously returnedvoid, discarding the response. This changes it to return theResponseInterface— a backward-compatible widening, so existing callers that ignore the return value are unaffected.This lets a client decode the raw response body itself when the array-based
sendRequestAndMapResponse()is unsuitable — e.g. payloads that must preserve the JSON object/array distinction, which an associative-array decode would lose ({}collapses to[], integer-keyed objects get renumbered). The first consumer is thesync-actions-api-php-clientmigration.Now that
sendRequest()returns the response, the privatedoSendRequest()was a redundant indirection — it is folded intosendRequest(), which gains the optional per-request$options(already public viasendRequestAndMapResponse()).Plans for customer communication
None.
Impact analysis
No end-user impact. Backward-compatible for all existing consumers — a
voidmethod now returns a value callers may ignore. The four already-migrated clients (vault, sandboxes, git-service, configuration-variables-resolver) are exercised by CI here and are unaffected.Change type
Improvement
Justification
Enable clients to decode raw response bodies, needed by the sync-actions migration (PAT-1866).
Deployment
Merge & automatic deploy.
Rollback plan
Revert of this PR.
Post release support plan
None.