Repository navigation
fix(parser): support camelCase replyTo in SesMailCommonHeaders - #8542
leandrodamascena merged 3 commits into
Conversation
…ws-powertools#8523) Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8542 +/- ##
========================================
Coverage 96.96% 96.96%
========================================
Files 317 317
Lines 15932 15932
Branches 1403 1403
========================================
Hits 15448 15448
Misses 349 349
Partials 135 135 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @reginaldalfret! I was able to reproduce the bug and confirm the fix. I pushed a small commit to your branch applying ruff format to the test file so the quality check passes, nothing else changed.
Thanks also to @LuisFigueroaG for the detailed report. Approving!
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
|
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |



Issue number: closes #8523
Summary
Changes
SesMailCommonHeaders.reply_towithvalidation_alias=AliasChoices("replyTo", "reply-to", "reply_to")andserialization_alias="replyTo", ensuring standard SES notifications parse correctly while retaining backward compatibility for any existing usage.tests/unit/parser/_pydantic/test_ses.pycovering standard camelCase SES payloads, hyphenated payloads, and keyword argument instantiation.User experience
In SES email receiving notifications, the
mail.commonHeadersobject provides the Reply-To addresses under the camelCase keyreplyTo(matching the SES API specification andSESMail.reply_toinaws_lambda_powertools.utilities.data_classes.ses_event).Previously,
SesMailCommonHeadersinaws_lambda_powertools.utilities.parser.models.sesdeclared the alias strictly as"reply-to". Consequently, whenever SES payloads containingcommonHeaders.replyTowere parsed withSesModel, thereply_tofield was ignored and evaluated toNone.With this fix, SES event payloads with
commonHeaders.replyTocorrectly populatereply_to.Verification
pytest tests/unit/parser/_pydantic/test_ses.py: 2 passed cleanly.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.