-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix(templates): ensure requestOptions
follow same format
#506
Conversation
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
requestOptions
follow same formatrequestOptions
follow same format
3cc3d52
to
837b478
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ! I'm not entirely sure of when query params should be stringified, should it be last second before creating the URL, or as soon as we receive them they get stored as string ?
.../algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts
Show resolved
Hide resolved
clients/algoliasearch-client-javascript/packages/client-common/src/types/Transporter.ts
Outdated
Show resolved
Hide resolved
I've went with what was the easiest for the current implem to avoid changing everything, I feel like to avoid redundancy it's best to apply it when we will use them rather than in every methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement ! I reviewed and tested the changes on my local env and it works fine ! :)
.../algoliasearch-client-javascript/packages/client-common/src/transporter/createTransporter.ts
Outdated
Show resolved
Hide resolved
// handled in the `serializeUrl` step right after. | ||
if ( | ||
!value || | ||
Object.prototype.toString.call(value) === '[object Object]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how we can get object here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const requestOptions = {
queryParameters: {
myParam: { a: 'b' },
},
}
idk if we should allow this in JS but as it's the case in the current client, we can keep the same logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about all this but let's go
🧭 What and Why
🎟 JIRA Ticket: -
Changes included:
Changes in this PR were added in #501, but are unrelated to the task.
Java/JavaScript:
queryParameters
Java/JavaScript/PHP:
requestOptions.queryParameters
are handled the same way than methodqueryParameters
PHP:
🧪 Test
CI :D