Skip to content

fix(event_handler): fix ALB resolver returns when response body is None#8194

Merged
leandrodamascena merged 4 commits intodevelopfrom
fix/8186
May 4, 2026
Merged

fix(event_handler): fix ALB resolver returns when response body is None#8194
leandrodamascena merged 4 commits intodevelopfrom
fix/8186

Conversation

@leandrodamascena
Copy link
Copy Markdown
Contributor

Issue number: closes #8186

Summary

ALB resolver converts body=None to body="" to prevent ALB 5xx errors, but this conversion happens before the response validation middleware runs. Validation then sees "" instead of None and fails with none_required for handlers returning -> None.

Fix: in the validation middleware, treat empty string body as None when the return type is None.

Changes

Please provide a summary of what's being changed

User experience

Please share what the user experience looks like before and after this change


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.

@leandrodamascena leandrodamascena requested a review from a team as a code owner May 2, 2026 15:21
@leandrodamascena leandrodamascena requested a review from hjgraca May 2, 2026 15:21
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.72%. Comparing base (5b8ba36) to head (d52eab7).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8194   +/-   ##
========================================
  Coverage    96.72%   96.72%           
========================================
  Files          286      286           
  Lines        14341    14342    +1     
  Branches      1200     1200           
========================================
+ Hits         13871    13872    +1     
  Misses         341      341           
  Partials       129      129           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena leandrodamascena requested review from svozza and removed request for hjgraca May 2, 2026 15:34
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 3, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 4, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 4, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

@leandrodamascena leandrodamascena merged commit 53678cf into develop May 4, 2026
15 checks passed
@leandrodamascena leandrodamascena deleted the fix/8186 branch May 4, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

event_handlers size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Inconsistent validation of empty responses between ALBResolver and APIGatewayHttpResolver

3 participants