Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0#14077
⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0#14077tiangolo merged 3 commits intofastapi:masterfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Kludex commentedSep 14, 2025
If we use 429 instead of the constant, there's no need to bump. Maybe we should do that? |
musicinmybrain commentedSep 14, 2025
As in, just write literal integer |
tiangolo commentedSep 15, 2025
Yep, I think a literal |
Restore support for Starlette 0.40 through 0.47 (without deprecationwarnings in Starlette 0.48) by using the literal integer `422` or stringrepresentation `"422"` in place of either the new RFC 9110 name`HTTP_422_UNPROCESSABLE_CONTENT` or the earlier RFC 7231 name`HTTP_422_UNPROCESSABLE_ENTITY`.
This comment was marked as outdated.
This comment was marked as outdated.
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commit0e23139 at:https://e30477a7.fastapitiangolo.pages.dev |
tiangolo left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
7563579 intofastapi:masterUh oh!
There was an error while loading.Please reload this page.
<!-- .github/pull_request_template.md -->## Description<!--Please provide a clear, human-generated description of the changes inthis PR.DO NOT use AI-generated descriptions. We want to understand your thoughtprocess and reasoning.-->In `uv.lock`, we've already been using fastapi version 0.119.0 for awhile.However, with#1586 changes we can't allow fastapi to be lower than0.116.2.Seefastapi/fastapi#14077## Type of Change<!-- Please check the relevant option -->- [ ] Bug fix (non-breaking change that fixes an issue)- [ ] New feature (non-breaking change that adds functionality)- [ ] Breaking change (fix or feature that would cause existingfunctionality to change)- [ ] Documentation update- [ ] Code refactoring- [ ] Performance improvement- [ ] Other (please specify):## Screenshots/Videos (if applicable)<!-- Add screenshots or videos to help explain your changes -->## Pre-submission Checklist<!-- Please check all boxes that apply before submitting your PR -->- [ ] **I have tested my changes thoroughly before submitting this PR**- [ ] **This PR contains minimal changes necessary to address theissue/feature**- [ ] My code follows the project's coding standards and styleguidelines- [ ] I have added tests that prove my fix is effective or that myfeature works- [ ] I have added necessary documentation (if applicable)- [ ] All new and existing tests pass- [ ] I have searched existing PRs to ensure this change hasn't beensubmitted already- [ ] I have linked any relevant issues in the description- [ ] My commits have clear and descriptive messages## DCO AffirmationI affirm that all code in every commit of this pull request conforms tothe terms of the Topoteretes Developer Certificate of Origin.
Starting from `starlette >= 0.48`, the `status.HTTP_422_UNPROCESSABLE_ENTITY`emits a deprecation warning, as it has been replaced by`status.HTTP_422_UNPROCESSABLE_CONTENT`.To be compatible with past and future versions, we simply use the integer value`422`, aligning also with the updated `fastapi` documentation:See:-fastapi/fastapi#14077
Uh oh!
There was an error while loading.Please reload this page.
Starlette 0.48.0 introduced
HTTP_422_UNPROCESSABLE_CONTENTas a new name forHTTP_422_UNPROCESSABLE_ENTITYand deprecated the old name due to RFC 9110; seeKludex/starlette#2939.I updated all instances
to the new name and increased the lower bound on the Starlette versionto use the literal integer or string value422/"422"instead of eitherHTTP_422_UNPROCESSABLE_CONTENTorHTTP_422_UNPROCESSABLE_ENTITY, which makes FastAPI compatible with Starlette >=0.48 without deprecation warnings while preserving backwards compatibility with Starlette<0.48.@Kludex, FYI.