Skip to content

Conversation

@amin-farjadi
Copy link
Contributor

@amin-farjadi amin-farjadi commented Feb 10, 2026

Issue number: closes #5887, #6216

Summary

Fix openapi response validation behaviour on Falsy return objects.

Changes

in openapi_validation.py, OpenAPIResponseValidationMiddleware class:

  • behaviour of _handle_response method modified
  • behaviour of _serialize_response method modified
  • _serialize_response method renamed to _serialize_response_with_validation

in test_openapi_validation_middleware.py:

in test_http_resolver_pydantic.py:

User experience

Now Falsy response will be validated againt the OpenAPI return field (is there is any).


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.

@amin-farjadi amin-farjadi requested a review from a team as a code owner February 10, 2026 09:27
@amin-farjadi amin-farjadi requested a review from sdangol February 10, 2026 09:27
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 10, 2026
@github-actions github-actions bot added the bug Something isn't working label Feb 10, 2026
@sonarqubecloud
Copy link

@powertools-for-aws-oss-automation

Not all issues are linked correctly.

Please link each issue to the PR either manually or using a closing keyword in the format fixes #<issue-number> format.

If mentioning more than one issue, separate them with commas: i.e. fixes #<issue-number-1>, closes #<issue-number-2>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working event_handlers size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Open API Validation not validating response serialization when body is Falsy.

2 participants