fix: [DOCSPLAT-2058] Allow params serializer - for arrays by lopenchi · Pull Request #1433 · sendgrid/sendgrid-nodejs
Fixes
- Allows seralization for query params. Info taken for this forum
Before fix:
/v3/marketing/integrations?ids[]=id1&ids[]=id2
After:
/v3/marketing/integrations?ids=id1&ids=id2
--
Doing this change because it was failing when testing SDK with prism, not sure if it failing when calling API.
For reference this is the code sample used:
const client = require("@sendgrid/client"); client.setApiKey(process.env.SENDGRID_API_KEY); const queryParams = { ids: ["id1", "id2"] }; const request = { url: `/v3/marketing/integrations`, method: "DELETE", qs: queryParams, }; client .request(request) .then(([response, body]) => { console.log(response.statusCode); console.log(response.body); }) .catch((error) => { console.error(error); });
Checklist
- I acknowledge that all my contributions will be made under the project's license
- I have made a material change to the repo (functionality, testing, spelling, grammar)
- I have read the Contribution Guidelines and my PR follows them
- I have titled the PR appropriately
- I have updated my branch with the main branch
- I have added tests that prove my fix is effective or that my feature works
- I have added the necessary documentation about the functionality in the appropriate .md file
- I have added inline documentation to the code I modified
If you have questions, please file a support ticket.