refactor(javascript): simplify transporter.request #617
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.
🧭 What and Why
Simplify
transporter.request
by turning it from three arguments to only two.I can't see any significant difference between the first (request) and second (methodOptions) argument of
request
, so this PR changes that to both be in the first argument. requestOptions is still separate.Other API clients don't seem to distinguish that clearly in the arguments to sendRequest, as they use mostly positional arguments
PHP:
api-clients-automation/templates/php/api.mustache
Line 263 in bf42712
Java:
api-clients-automation/templates/java/libraries/okhttp-gson/api.mustache
Line 196 in bf42712
Changes included:
🧪 Test
This is a breaking change if you'd be using a custom request using the requester, but I guess that doesn't count yet.
If there's a historic reason for why there are three arguments and not two, feel free to research that too