sendgrid-nodejs icon indicating copy to clipboard operation
sendgrid-nodejs copied to clipboard

fix: [DOCSPLAT-2058] Allow params serializer - for arrays

Open lopenchi opened this issue 8 months ago • 0 comments

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

  • [x] 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.

lopenchi avatar Mar 21 '25 16:03 lopenchi