Skip to content

⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0 - #14077

Merged
tiangolo merged 3 commits into
fastapi:masterfrom
musicinmybrain:starlette-0.48
Sep 16, 2025
Merged

tiangolo merged 3 commits into
fastapi:masterfrom
musicinmybrain:starlette-0.48

Conversation

@musicinmybrain

@musicinmybrain musicinmybrain commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

Starlette 0.48.0 introduced HTTP_422_UNPROCESSABLE_CONTENT as a new name for HTTP_422_UNPROCESSABLE_ENTITY and deprecated the old name due to RFC 9110; see Kludex/starlette#2939.

I updated all instances to the new name and increased the lower bound on the Starlette version to use the literal integer or string value 422/"422" instead of either HTTP_422_UNPROCESSABLE_CONTENT or HTTP_422_UNPROCESSABLE_ENTITY, which makes FastAPI compatible with Starlette >=0.48 without deprecation warnings while preserving backwards compatibility with Starlette<0.48.

@Kludex, FYI.

@github-actions

This comment was marked as outdated.

@Kludex

Kludex commented Sep 14, 2025

Copy link
Copy Markdown
Member

If we use 429 instead of the constant, there's no need to bump.

Maybe we should do that?

@musicinmybrain

Copy link
Copy Markdown
Contributor Author

If we use 429 instead of the constant, there's no need to bump.

Maybe we should do that?

As in, just write literal integer 422? Sure, that’s a sensible idea, and it would be easy enough to do. @tiangolo, do you have a preference one way or the other?

@tiangolo

Copy link
Copy Markdown
Member

Yep, I think a literal 422 should be enough, and that way we avoid having to restrict the lower bound limit, which is otherwise not necessary. 🤓

Restore support for Starlette 0.40 through 0.47 (without deprecation
warnings in Starlette 0.48) by using the literal integer `422` or string
representation `"422"` in place of either the new RFC 9110 name
`HTTP_422_UNPROCESSABLE_CONTENT` or the earlier RFC 7231 name
`HTTP_422_UNPROCESSABLE_ENTITY`.
@musicinmybrain musicinmybrain changed the title ⬆️ Upgrade Starlette supported version range to >=0.48.0,<0.49.0 ⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0 Sep 15, 2025
@github-actions

This comment was marked as outdated.

Comment thread docs_src/handling_errors/tutorial005.py
@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview for commit 0e23139 at: https://e30477a7.fastapitiangolo.pages.dev

@tiangolo tiangolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you! 🚀

And thanks @Kludex and @svlandeg! 🙌

This will be available in FastAPI 0.116.2, released in the next hours.

@tiangolo
tiangolo merged commit 7563579 into fastapi:master Sep 16, 2025
53 checks passed
Vasilije1990 added a commit to topoteretes/cognee that referenced this pull request Oct 22, 2025
<!-- .github/pull_request_template.md -->

## Description
<!--
Please provide a clear, human-generated description of the changes in
this PR.
DO NOT use AI-generated descriptions. We want to understand your thought
process and reasoning.
-->

In `uv.lock`, we've already been using fastapi version 0.119.0 for a
while.

However, with #1586 changes we can't allow fastapi to be lower than
0.116.2.

See fastapi/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 existing
functionality 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 the
issue/feature**
- [ ] My code follows the project's coding standards and style
guidelines
- [ ] I have added tests that prove my fix is effective or that my
feature 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 been
submitted already
- [ ] I have linked any relevant issues in the description
- [ ] My commits have clear and descriptive messages

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.
ivantodorovich added a commit to camptocamp/rest-framework that referenced this pull request Nov 3, 2025
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
florian-dacosta pushed a commit to akretion/rest-framework that referenced this pull request Mar 26, 2026
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
lmignon pushed a commit to acsone/rest-framework that referenced this pull request Apr 16, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants