Skip to content

Conversation

@leandrodamascena
Copy link
Contributor

Issue number: closes #

Fixes a regression introduced in PR #7227 where annotated_types constraints (like Interval) were not being validated in request parameters.

The issue occurred in the copy_field_info() function when switching from FieldInfo.from_annotation() to copy(). While this preserved discriminator functionality, it discarded constraint metadata from nested Annotated types.

Changes

  • Modified copy_field_info() to recursively extract and preserve constraint metadata while filtering out FieldInfo instances
  • Updated get_field_info_annotated_type() to maintain consistency
  • Added tests covering valid values, boundary conditions, and validation failures for both Body and Query parameters

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 October 31, 2025 11:19
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 31, 2025
@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>.

@github-actions github-actions bot added the bug Something isn't working label Oct 31, 2025
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.52%. Comparing base (a676660) to head (9554461).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7609   +/-   ##
========================================
  Coverage    96.52%   96.52%           
========================================
  Files          275      275           
  Lines        13114    13118    +4     
  Branches       985      986    +1     
========================================
+ Hits         12658    12662    +4     
  Misses         353      353           
  Partials       103      103           

☔ 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 self-assigned this Oct 31, 2025
@sonarqubecloud
Copy link

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.

1 participant