Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@leandrodamascena
Copy link
Contributor

@leandrodamascena leandrodamascena commented Oct 31, 2025

Issue number: closes #7600

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
@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 (9218a6e) to head (1a2e747).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7609   +/-   ##
========================================
  Coverage    96.52%   96.52%           
========================================
  Files          275      275           
  Lines        13114    13117    +3     
  Branches       985      986    +1     
========================================
+ Hits         12658    12661    +3     
  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

sonarqubecloud bot commented Nov 3, 2025

@leandrodamascena leandrodamascena merged commit 21d9f41 into develop Nov 3, 2025
14 checks passed
@leandrodamascena leandrodamascena deleted the fix/annotation branch November 3, 2025 11:35
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: Incomplete validation of annotated parameter types (3.21.0 regression)

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.