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

Type inconsistency: replyToList accepts EmailJSON | EmailJSON[] in types but requires EmailJSON[] at runtime

Open NumanAnees opened this issue 5 months ago • 0 comments

Problem

There's a type inconsistency in the Mail class regarding replyToList:

Type Definition suggests both formats are valid: https://github.com/sendgrid/sendgrid-nodejs/blob/2bac86884f71be3fb19f96a10c02a1fb616b81fc/packages/helpers/classes/mail.d.ts#L168

But, Runtime Validation enforces array-only: https://github.com/sendgrid/sendgrid-nodejs/blob/2bac86884f71be3fb19f96a10c02a1fb616b81fc/packages/helpers/classes/mail.d.ts#L372

https://github.com/sendgrid/sendgrid-nodejs/blob/2bac86884f71be3fb19f96a10c02a1fb616b81fc/packages/helpers/classes/mail.js#L679

Impact

This inconsistency causes runtime errors

Error: Array expected for replyToList

NumanAnees avatar Jun 28 '25 11:06 NumanAnees