Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • A aurweb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 88
    • Issues 88
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Arch LinuxArch Linux
  • aurweb
  • Merge requests
  • !530

fix(deps): update dependency fastapi to ^0.83.0

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged renovate requested to merge renovate/fastapi-0.x into master Sep 06, 2022
  • Overview 0
  • Commits 1
  • Pipelines 17
  • Changes 2

This MR contains the following updates:

Package Change Age Adoption Passing Confidence
fastapi ^0.71.0 -> ^0.83.0 age adoption passing confidence

Release Notes

tiangolo/fastapi

v0.83.0

Compare Source

🚨 This is probably the last release (or one of the last releases) to support Python 3.6. 🔥

Python 3.6 reached the end-of-life and is no longer supported by Python since around a year ago.

You hopefully updated to a supported version of Python a while ago. If you haven't, you really should.

Features
  • ✨ Add support in jsonable_encoder for include and exclude with dataclasses. MR #​4923 by @​DCsunset.
Fixes
  • 🐛 Fix RuntimeError raised when HTTPException has a status code with no content. MR #​5365 by @​iudeen.
  • 🐛 Fix empty reponse body when default status_code is empty but the a Response parameter with response.status_code is set. MR #​5360 by @​tmeckel.
Docs
  • 📝 Update SECURITY.md. MR #​5377 by @​Kludex.
Internal
  • ⬆ [pre-commit.ci] pre-commit autoupdate. MR #​5352 by @​pre-commit-ci[bot].

v0.82.0

Compare Source

🚨 This is probably the last release (or one of the last releases) to support Python 3.6. 🔥

Python 3.6 reached the end-of-life and is no longer supported by Python since around a year ago.

You hopefully updated to a supported version of Python a while ago. If you haven't, you really should.

Features
  • ✨ Export WebSocketState in fastapi.websockets. MR #​4376 by @​matiuszka.
  • ✨ Support Python internal description on Pydantic model's docstring. MR #​3032 by @​Kludex.
  • ✨ Update ORJSONResponse to support non str keys and serializing Numpy arrays. MR #​3892 by @​baby5.
Fixes
  • 🐛 Allow exit code for dependencies with yield to always execute, by removing capacity limiter for them, to e.g. allow closing DB connections without deadlocks. MR #​5122 by @​adriangb.
  • 🐛 Fix FastAPI People GitHub Action: set HTTPX timeout for GraphQL query request. MR #​5222 by @​iudeen.
  • 🐛 Make sure a parameter defined as required is kept required in OpenAPI even if defined as optional in another dependency. MR #​4319 by @​cd17822.
  • 🐛 Fix support for path parameters in WebSockets. MR #​3879 by @​davidbrochart.
Docs
  • ✏ Update Hypercorn link, now pointing to GitHub. MR #​5346 by @​baconfield.
  • ✏ Tweak wording in docs/en/docs/advanced/dataclasses.md. MR #​3698 by @​pfackeldey.
  • 📝 Add note about Python 3.10 X | Y operator in explanation about Response Models. MR #​5307 by @​MendyLanda.
  • 📝 Add link to New Relic article: "How to monitor FastAPI application performance using Python agent". MR #​5260 by @​sjyothi54.
  • 📝 Update docs for ORJSONResponse with details about improving performance. MR #​2615 by @​falkben.
  • 📝 Add docs for creating a custom Response class. MR #​5331 by @​tiangolo.
  • 📝 Add tip about using alias for form data fields. MR #​5329 by @​tiangolo.
Translations
  • 🌐 Add Russian translation for docs/ru/docs/features.md. MR #​5315 by @​Xewus.
  • 🌐 Update Chinese translation for docs/zh/docs/tutorial/request-files.md. MR #​4529 by @​ASpathfinder.
  • 🌐 Add Chinese translation for docs/zh/docs/tutorial/encoder.md. MR #​4969 by @​Zssaer.
  • 🌐 Fix MkDocs file line for Portuguese translation of background-task.md. MR #​5242 by @​ComicShrimp.
Internal
  • 👥 Update FastAPI People. MR #​5347 by @​github-actions[bot].
  • ⬆ Bump dawidd6/action-download-artifact from 2.22.0 to 2.23.0. MR #​5321 by @​dependabot[bot].
  • ⬆ [pre-commit.ci] pre-commit autoupdate. MR #​5318 by @​pre-commit-ci[bot].
  • ✏ Fix a small code highlight line error. MR #​5256 by @​hjlarry.
  • ♻ Internal small refactor, move operation_id parameter position in delete method for consistency with the code. MR #​4474 by @​hiel.
  • 🔧 Update sponsors, disable ImgWhale. MR #​5338 by @​tiangolo.

v0.81.0

Compare Source

Features
  • ✨ Add ReDoc <noscript> warning when JS is disabled. MR #​5074 by @​evroon.
  • ✨ Add support for FrozenSet in parameters (e.g. query). MR #​2938 by @​juntatalor.
  • ✨ Allow custom middlewares to raise HTTPExceptions and propagate them. MR #​2036 by @​ghandic.
  • ✨ Preserve json.JSONDecodeError information when handling invalid JSON in request body, to support custom exception handlers that use its information. MR #​4057 by @​UKnowWhoIm.
Fixes
  • 🐛 Fix jsonable_encoder for dataclasses with pydantic-compatible fields. MR #​3607 by @​himbeles.
  • 🐛 Fix support for extending openapi_extras with parameter lists. MR #​4267 by @​orilevari.
Docs
  • ✏ Fix a simple typo in docs/en/docs/python-types.md. MR #​5193 by @​GlitchingCore.
  • ✏ Fix typos in tests/test_schema_extra_examples.py. MR #​5126 by @​supraaxdd.
  • ✏ Fix typos in docs/en/docs/tutorial/path-params-numeric-validations.md. MR #​5142 by @​invisibleroads.
  • 📝 Add step about upgrading pip in the venv to avoid errors when installing dependencies docs/en/docs/contributing.md. MR #​5181 by @​edisnake.
  • ✏ Reword and clarify text in tutorial docs/en/docs/tutorial/body-nested-models.md. MR #​5169 by @​papb.
  • ✏ Fix minor typo in docs/en/docs/features.md. MR #​5206 by @​OtherBarry.
  • ✏ Fix minor typos in docs/en/docs/async.md. MR #​5125 by @​Ksenofanex.
  • 📝 Add external link to docs: "Fastapi, Docker(Docker compose) and Postgres". MR #​5033 by @​krishnardt.
  • 📝 Simplify example for docs for Additional Responses, remove unnecessary else. MR #​4693 by @​adriangb.
  • 📝 Update docs, compare enums with identity instead of equality. MR #​4905 by @​MicaelJarniac.
  • ✏ Fix typo in docs/en/docs/python-types.md. MR #​4886 by @​MicaelJarniac.
  • 🎨 Fix syntax highlighting in docs for OpenAPI Callbacks. MR #​4368 by @​xncbf.
  • ✏ Reword confusing sentence in docs file typo-fix-path-params-numeric-validations.md. MR #​3219 by @​ccrenfroe.
  • 📝 Update docs for handling HTTP Basic Auth with secrets.compare_digest() to account for non-ASCII characters. MR #​3536 by @​lewoudar.
  • 📝 Update docs for testing, fix examples with relative imports. MR #​5302 by @​tiangolo.
Translations
  • 🌐 Add Russian translation for docs/ru/docs/index.md. MR #​5289 by @​impocode.
  • 🌐 Add Russian translation for docs/ru/docs/deployment/versions.md. MR #​4985 by @​emp7yhead.
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/header-params.md. MR #​4921 by @​batlopes.
  • 🌐 Update ko/mkdocs.yml for a missing link. MR #​5020 by @​dalinaum.
Internal
  • ⬆ Bump dawidd6/action-download-artifact from 2.21.1 to 2.22.0. MR #​5258 by @​dependabot[bot].
  • ⬆ [pre-commit.ci] pre-commit autoupdate. MR #​5196 by @​pre-commit-ci[bot].
  • 🔥 Delete duplicated tests in tests/test_tutorial/test_sql_databases/test_sql_databases.py. MR #​5040 by @​raccoonyy.
  • ♻ Simplify internal RegEx in fastapi/utils.py. MR #​5057 by @​pylounge.
  • 🔧 Fix Type hint of auto_error which does not need to be Optional[bool]. MR #​4933 by @​DavidKimDY.
  • 🔧 Update mypy config, use strict = true instead of manual configs. MR #​4605 by @​michaeloliverx.
  • ♻ Change a dict() for {} in fastapi/utils.py. MR #​3138 by @​ShahriyarR.
  • ♻ Move internal variable for errors in jsonable_encoder to put related code closer. MR #​4560 by @​GuilleQP.
  • ♻ Simplify conditional assignment in fastapi/dependencies/utils.py. MR #​4597 by @​cikay.
  • ⬆ Upgrade version pin accepted for Flake8, for internal code, to flake8 >=3.8.3,<6.0.0. MR #​4097 by @​jamescurtin.
  • 🍱 Update Jina banner, fix typo. MR #​5301 by @​tiangolo.

v0.80.0

Compare Source

Breaking Changes - Fixes
  • 🐛 Fix response_model not invalidating None. MR #​2725 by @​hukkin.

If you are using response_model with some type that doesn't include None but the function is returning None, it will now raise an internal server error, because you are returning invalid data that violates the contract in response_model. Before this release it would allow breaking that contract returning None.

For example, if you have an app like this:

from fastapi import FastAPI
from pydantic import BaseModel

class Item(BaseModel):
    name: str
    price: Optional[float] = None
    owner_ids: Optional[List[int]] = None

app = FastAPI()

@&#8203;app.get("/items/invalidnone", response_model=Item)
def get_invalid_none():
    return None

...calling the path /items/invalidnone will raise an error, because None is not a valid type for the response_model declared with Item.

You could also be implicitly returning None without realizing, for example:

from fastapi import FastAPI
from pydantic import BaseModel

class Item(BaseModel):
    name: str
    price: Optional[float] = None
    owner_ids: Optional[List[int]] = None

app = FastAPI()

@&#8203;app.get("/items/invalidnone", response_model=Item)
def get_invalid_none():
    if flag:
        return {"name": "foo"}
### if flag is False, at this point the function will implicitly return None

If you have path operations using response_model that need to be allowed to return None, make it explicit in response_model using Union[Something, None]:

from typing import Union

from fastapi import FastAPI
from pydantic import BaseModel

class Item(BaseModel):
    name: str
    price: Optional[float] = None
    owner_ids: Optional[List[int]] = None

app = FastAPI()

@&#8203;app.get("/items/invalidnone", response_model=Union[Item, None])
def get_invalid_none():
    return None

This way the data will be correctly validated, you won't have an internal server error, and the documentation will also reflect that this path operation could return None (or null in JSON).

Fixes
  • ⬆ Upgrade Swagger UI copy of oauth2-redirect.html to include fixes for flavors of authorization code flows in Swagger UI. MR #​3439 initial MR by @​koonpeng.
  • ♻ Strip empty whitespace from description extracted from docstrings. MR #​2821 by @​and-semakin.
  • 🐛 Fix cached dependencies when using a dependency in Security() and other places (e.g. Depends()) with different OAuth2 scopes. MR #​2945 by @​laggardkernel.
  • 🎨 Update type annotations for response_model, allow things like Union[str, None]. MR #​5294 by @​tiangolo.
Translations
  • 🌐 Fix typos in German translation for docs/de/docs/features.md. MR #​4533 by @​0xflotus.
  • 🌐 Add missing navigator for encoder.md in Korean translation. MR #​5238 by @​joonas-yoon.
  • (Empty MR merge by accident) #​4913.

v0.79.1

Compare Source

Fixes
  • 🐛 Fix jsonable_encoder using include and exclude parameters for non-Pydantic objects. MR #​2606 by @​xaviml.
  • 🐛 Fix edge case with repeated aliases names not shown in OpenAPI. MR #​2351 by @​klaa97.
  • 📝 Add misc dependency installs to tutorial docs. MR #​2126 by @​TeoZosa.
Docs
  • 📝 Add note giving credit for illustrations to Ketrina Thompson. MR #​5284 by @​tiangolo.
  • ✏ Fix typo in python-types.md. MR #​5116 by @​Kludex.
  • ✏ Fix typo in docs/en/docs/python-types.md. MR #​5007 by @​atiabbz.
  • 📝 Remove unneeded Django/Flask references from async topic intro. MR #​5280 by @​carltongibson.
  • ✨ Add illustrations for Concurrent burgers and Parallel burgers. MR #​5277 by @​tiangolo. Updated docs at: Concurrency and Burgers.
Translations
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/query-params.md. MR #​4775 by @​batlopes.
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/security/first-steps.md. MR #​4954 by @​FLAIR7.
  • 🌐 Add translation for docs/zh/docs/advanced/response-cookies.md. MR #​4638 by @​zhangbo2012.
  • 🌐 Add French translation for docs/fr/docs/deployment/index.md. MR #​3689 by @​rjNemo.
  • 🌐 Add Portuguese translation for tutorial/handling-errors.md. MR #​4769 by @​frnsimoes.
  • 🌐 Add French translation for docs/fr/docs/history-design-future.md. MR #​3451 by @​rjNemo.
  • 🌐 Add Russian translation for docs/ru/docs/tutorial/background-tasks.md. MR #​4854 by @​AdmiralDesu.
  • 🌐 Add Chinese translation for docs/tutorial/security/first-steps.md. MR #​3841 by @​jaystone776.
  • 🌐 Add Japanese translation for docs/ja/docs/advanced/nosql-databases.md. MR #​4205 by @​sUeharaE4.
  • 🌐 Add Indonesian translation for docs/id/docs/tutorial/index.md. MR #​4705 by @​bas-baskara.
  • 🌐 Add Persian translation for docs/fa/docs/index.md and tweak right-to-left CSS. MR #​2395 by @​mohsen-mahmoodi.
Internal
  • 🔧 Update Jina sponsorship. MR #​5283 by @​tiangolo.
  • 🔧 Update Jina sponsorship. MR #​5272 by @​tiangolo.
  • 🔧 Update sponsors, Striveworks badge. MR #​5179 by @​tiangolo.

v0.79.0

Compare Source

Fixes - Breaking Changes
  • 🐛 Fix removing body from status codes that do not support it. MR #​5145 by @​tiangolo.
    • Setting status_code to 204, 304, or any code below 200 (1xx) will remove the body from the response.
    • This fixes an error in Uvicorn that otherwise would be thrown: RuntimeError: Response content longer than Content-Length.
    • This removes fastapi.openapi.constants.STATUS_CODES_WITH_NO_BODY, it is replaced by a function in utils.
Translations
  • 🌐 Start of Hebrew translation. MR #​5050 by @​itay-raveh.
  • 🔧 Add config for Swedish translations notification. MR #​5147 by @​tiangolo.
  • 🌐 Start of Swedish translation. MR #​5062 by @​MrRawbin.
  • 🌐 Add Japanese translation for docs/ja/docs/advanced/index.md. MR #​5043 by @​wakabame.
  • 🌐🇵🇱 Add Polish translation for docs/pl/docs/tutorial/first-steps.md. MR #​5024 by @​Valaraucoo.
Internal
  • 🔧 Update translations notification for Hebrew. MR #​5158 by @​tiangolo.
  • 🔧 Update Dependabot commit message. MR #​5156 by @​tiangolo.
  • ⬆ Bump actions/upload-artifact from 2 to 3. MR #​5148 by @​dependabot[bot].
  • ⬆ Bump actions/cache from 2 to 3. MR #​5149 by @​dependabot[bot].
  • 🔧 Update sponsors badge configs. MR #​5155 by @​tiangolo.
  • 👥 Update FastAPI People. MR #​5154 by @​tiangolo.
  • 🔧 Update Jina sponsor badges. MR #​5151 by @​tiangolo.
  • ⬆ Bump actions/checkout from 2 to 3. MR #​5133 by @​dependabot[bot].
  • ⬆ [pre-commit.ci] pre-commit autoupdate. MR #​5030 by @​pre-commit-ci[bot].
  • ⬆ Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3. MR #​5132 by @​dependabot[bot].
  • ⬆ Bump codecov/codecov-action from 2 to 3. MR #​5131 by @​dependabot[bot].
  • ⬆ Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1. MR #​5130 by @​dependabot[bot].
  • ⬆ Bump actions/setup-python from 2 to 4. MR #​5129 by @​dependabot[bot].
  • 👷 Add Dependabot. MR #​5128 by @​tiangolo.
  • ♻️ Move from Optional[X] to Union[X, None] for internal utils. MR #​5124 by @​tiangolo.
  • 🔧 Update sponsors, remove Dropbase, add Doist. MR #​5096 by @​tiangolo.
  • 🔧 Update sponsors, remove Classiq, add ImgWhale. MR #​5079 by @​tiangolo.

v0.78.0

Compare Source

Features
  • ✨ Add support for omitting ... as default value when declaring required parameters with:

  • Path()

  • Query()

  • Header()

  • Cookie()

  • Body()

  • Form()

  • File()

New docs at Tutorial - Query Parameters and String Validations - Make it required. MR #​4906 by @​tiangolo.

Up to now, declaring a required parameter while adding additional validation or metadata needed using ... (Ellipsis).

For example:

from fastapi import Cookie, FastAPI, Header, Path, Query

app = FastAPI()

@&#8203;app.get("/items/{item_id}")
def main(
    item_id: int = Path(default=..., gt=0),
    query: str = Query(default=..., max_length=10),
    session: str = Cookie(default=..., min_length=3),
    x_trace: str = Header(default=..., title="Tracing header"),
):
    return {"message": "Hello World"}

...all these parameters are required because the default value is ... (Ellipsis).

But now it's possible and supported to just omit the default value, as would be done with Pydantic fields, and the parameters would still be required.

✨ For example, this is now supported:

from fastapi import Cookie, FastAPI, Header, Path, Query

app = FastAPI()

@&#8203;app.get("/items/{item_id}")
def main(
    item_id: int = Path(gt=0),
    query: str = Query(max_length=10),
    session: str = Cookie(min_length=3),
    x_trace: str = Header(title="Tracing header"),
):
    return {"message": "Hello World"}

To declare parameters as optional (not required), you can set a default value as always, for example using None:

from typing import Union
from fastapi import Cookie, FastAPI, Header, Path, Query

app = FastAPI()

@&#8203;app.get("/items/{item_id}")
def main(
    item_id: int = Path(gt=0),
    query: Union[str, None] = Query(default=None, max_length=10),
    session: Union[str, None] = Cookie(default=None, min_length=3),
    x_trace: Union[str, None] = Header(default=None, title="Tracing header"),
):
    return {"message": "Hello World"}
Docs
  • 📝 Add docs recommending Union over Optional and migrate source examples. New docs at Python Types Intro - Using Union or Optional. MR #​4908 by @​tiangolo.
  • 🎨 Fix default value as set in tutorial for Path Operations Advanced Configurations. MR #​4899 by @​tiangolo.
  • 📝 Add documentation for redefined path operations. MR #​4864 by @​madkinsz.
  • 📝 Updates links for Celery documentation. MR #​4736 by @​sammyzord.
  • ✏ Fix example code with sets in tutorial for body nested models. MR #​3030 by @​hitrust.
  • ✏ Fix links to Pydantic docs. MR #​4670 by @​kinuax.
  • 📝 Update docs about Swagger UI self-hosting with newer source links. MR #​4813 by @​Kastakin.
  • 📝 Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React. MR #​4778 by @​jbrocher.
  • 📝 Add OpenAPI warning to "Body - Fields" docs with extra schema extensions. MR #​4846 by @​ml-evs.
Translations
  • 🌐 Fix code examples in Japanese translation for docs/ja/docs/tutorial/testing.md. MR #​4623 by @​hirotoKirimaru.
Internal
  • ♻ Refactor dict value extraction to minimize key lookups fastapi/utils.py. MR #​3139 by @​ShahriyarR.
  • ✅ Add tests for required nonable parameters and body fields. MR #​4907 by @​tiangolo.
  • 👷 Fix installing Material for MkDocs Insiders in CI. MR #​4897 by @​tiangolo.
  • 👷 Add pre-commit CI instead of custom GitHub Action. MR #​4896 by @​tiangolo.
  • 👷 Add pre-commit GitHub Action workflow. MR #​4895 by @​tiangolo.
  • 📝 Add dark mode auto switch to docs based on OS preference. MR #​4869 by @​ComicShrimp.
  • 🔥 Remove un-used old pending tests, already covered in other places. MR #​4891 by @​tiangolo.
  • 🔧 Add Python formatting hooks to pre-commit. MR #​4890 by @​tiangolo.
  • 🔧 Add pre-commit with first config and first formatting pass. MR #​4888 by @​tiangolo.
  • 👷 Disable CI installing Material for MkDocs in forks. MR #​4410 by @​dolfinus.

v0.77.1

Compare Source

Upgrades
  • ⬆ Upgrade Starlette from 0.19.0 to 0.19.1. MR #​4819 by @​Kludex.
Docs
  • 📝 Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul. MR #​4624 by @​fschuermeyer.
  • 📝 Add external link: PyCharm Guide to FastAPI. MR #​4512 by @​mukulmantosh.
  • 📝 Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta. MR #​4440 by @​aUnicornDev.
  • ✏ Fix small typo in docs/en/docs/tutorial/security/first-steps.md. MR #​4515 by @​KikoIlievski.
Translations
  • 🌐 Add Polish translation for docs/pl/docs/tutorial/index.md. MR #​4516 by @​MKaczkow.
  • ✏ Fix typo in deployment. MR #​4629 by @​raisulislam541.
  • 🌐 Add Portuguese translation for docs/pt/docs/help-fastapi.md. MR #​4583 by @​mateusjs.
Internal
  • 🔧 Add notifications in issue for Uzbek translations. MR #​4884 by @​tiangolo.

v0.77.0

Compare Source

Upgrades
  • ⬆ Upgrade Starlette from 0.18.0 to 0.19.0. MR #​4488 by @​Kludex.
    • When creating an explicit JSONResponse the content argument is now required.
Docs
  • 📝 Add external link to article: Seamless FastAPI Configuration with ConfZ. MR #​4414 by @​silvanmelchior.
  • 📝 Add external link to article: 5 Advanced Features of FastAPI You Should Try. MR #​4436 by @​kaustubhgupta.
  • ✏ Reword to improve legibility of docs about TestClient. MR #​4389 by @​rgilton.
  • 📝 Add external link to blog post about Kafka, FastAPI, and Ably. MR #​4044 by @​Ugbot.
  • ✏ Fix typo in docs/en/docs/tutorial/sql-databases.md. MR #​4875 by @​wpyoga.
  • ✏ Fix typo in docs/en/docs/async.md. MR #​4726 by @​Prezu.
Translations
  • 🌐 Update source example highlights for docs/zh/docs/tutorial/query-params-str-validations.md. MR #​4237 by @​caimaoy.
  • 🌐 Remove translation docs references to aiofiles as it's no longer needed since AnyIO. MR #​3594 by @​alonme.
  • ✏ 🌐 Fix typo in Portuguese translation for docs/pt/docs/tutorial/path-params.md. MR #​4722 by @​CleoMenezesJr.
  • 🌐 Fix live docs server for translations for some languages. MR #​4729 by @​wakabame.
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/cookie-params.md. MR #​4112 by @​lbmendes.
  • 🌐 Fix French translation for docs/tutorial/body.md. MR #​4332 by @​Smlep.
  • 🌐 Add Japanese translation for docs/ja/docs/advanced/conditional-openapi.md. MR #​2631 by @​sh0nk.
  • 🌐 Fix Japanese translation of docs/ja/docs/tutorial/body.md. MR #​3062 by @​a-takahashi223.
  • 🌐 Add Portuguese translation for docs/pt/docs/tutorial/background-tasks.md. MR #​2170 by @​izaguerreiro.
  • 🌐 Add Portuguese translation for docs/deployment/deta.md. MR #​4442 by @​lsglucas.
  • 🌐 Add Russian translation for docs/async.md. MR #​4036 by @​Winand.
  • 🌐 Add Portuguese translation for docs/tutorial/body.md. MR #​3960 by @​leandrodesouzadev.
  • 🌐 Add Portuguese translation of tutorial/extra-data-types.md. MR #​4077 by @​luccasmmg.
  • 🌐 Update German translation for docs/features.md. MR #​3905 by @​jomue.

v0.76.0

Compare Source

Upgrades
  • ⬆ Upgrade Starlette from 0.17.1 to 0.18.0. MR #​4483 by @​Kludex.
Internal
  • 👥 Update FastAPI People. MR #​4847 by @​github-actions[bot].
  • 🔧 Add Budget Insight sponsor. MR #​4824 by @​tiangolo.
  • 🍱 Update sponsor, ExoFlare badge. MR #​4822 by @​tiangolo.
  • 🔧 Update sponsors, enable Dropbase again, update TalkPython link. MR #​4821 by @​tiangolo.

v0.75.2

Compare Source

This release includes upgrades to third-party packages that handle security issues. Although there's a chance these issues don't affect you in particular, please upgrade as soon as possible.

Fixes
  • ✅ Fix new/recent tests with new fixed ValidationError JSON Schema. MR #​4806 by @​tiangolo.
  • 🐛 Fix JSON Schema for ValidationError at field loc. MR #​3810 by @​dconathan.
  • 🐛 Fix support for prefix on APIRouter WebSockets. MR #​2640 by @​Kludex.
Upgrades
  • ⬆️ Update ujson ranges for CVE-2021-45958. MR #​4804 by @​tiangolo.
  • ⬆️ Upgrade dependencies upper range for extras "all". MR #​4803 by @​tiangolo.
  • ⬆ Upgrade Swagger UI - swagger-ui-dist@4. This handles a security issue in Swagger UI itself where it could be possible to inject HTML into Swagger UI. Please upgrade as soon as you can, in particular if you expose your Swagger UI (/docs) publicly to non-expert users. MR #​4347 by @​RAlanWright.
Internal
  • 🔧 Update sponsors, add: ExoFlare, Ines Course; remove: Dropbase, Vim.so, Calmcode; update: Striveworks, TalkPython and TestDriven.io. MR #​4805 by @​tiangolo.
  • ⬆️ Upgrade Codecov GitHub Action. MR #​4801 by @​tiangolo.

v0.75.1

Compare Source

Translations
  • 🌐 Start Dutch translations. MR #​4703 by @​tiangolo.
  • 🌐 Start Persian/Farsi translations. MR #​4243 by @​aminalaee.
  • ✏ Reword sentence about handling errors. MR #​1993 by @​khuhroproeza.
Internal
  • 👥 Update FastAPI People. MR #​4752 by @​github-actions[bot].
  • ➖ Temporarily remove typer-cli from dependencies and upgrade Black to unblock Pydantic CI. MR #​4754 by @​tiangolo.
  • 🔧 Add configuration to notify Dutch translations. MR #​4702 by @​tiangolo.
  • 👥 Update FastAPI People. MR #​4699 by @​github-actions[bot].
  • 🐛 Fix FastAPI People generation to include missing file in commit. MR #​4695 by @​tiangolo.
  • 🔧 Update Classiq sponsor links. MR #​4688 by @​tiangolo.
  • 🔧 Add Classiq sponsor. MR #​4671 by @​tiangolo.
  • 📝 Add Jina's QA Bot to the docs to help people that want to ask quick questions. MR #​4655 by @​tiangolo based on original MR #​4626 by @​hanxiao.

v0.75.0

Compare Source

Features
  • ✨ Add support for custom generate_unique_id_function and docs for generating clients. New docs: Advanced - Generate Clients. MR #​4650 by @​tiangolo.

v0.74.1

Compare Source

Features
  • ✨ Include route in scope to allow middleware and other tools to extract its information. MR #​4603 by @​tiangolo.

v0.74.0

Compare Source

Breaking Changes
  • ✨ Update internal AsyncExitStack to fix context for dependencies with yield. MR #​4575 by @​tiangolo.

Dependencies with yield can now catch HTTPException and custom exceptions. For example:

async def get_database():
    with Session() as session:
        try:
            yield session
        except HTTPException:
            session.rollback()
            raise
        finally:
            session.close()

After the dependency with yield handles the exception (or not) the exception is raised again. So that any exception handlers can catch it, or ultimately the default internal ServerErrorMiddleware.

If you depended on exceptions not being received by dependencies with yield, and receiving an exception breaks the code after yield, you can use a block with try and finally:

async def do_something():
    try:
        yield something
    finally:
        some_cleanup()

...that way the finally block is run regardless of any exception that might happen.

Features
  • The same MR #​4575 from above also fixes the contextvars context for the code before and after yield. This was the main objective of that MR.

This means that now, if you set a value in a context variable before yield, the value would still be available after yield (as you would intuitively expect). And it also means that you can reset the context variable with a token afterwards.

For example, this works correctly now:

from contextvars import ContextVar
from typing import Any, Dict, Optional

legacy_request_state_context_var: ContextVar[Optional[Dict[str, Any]]] = ContextVar(
    "legacy_request_state_context_var", default=None
)

async def set_up_request_state_dependency():
    request_state = {"user": "deadpond"}
    contextvar_token = legacy_request_state_context_var.set(request_state)
    yield request_state
    legacy_request_state_context_var.reset(contextvar_token)

...before this change it would raise an error when resetting the context variable, because the contextvars context was different, because of the way it was implemented.

Note: You probably don't need contextvars, and you should probably avoid using them. But they are powerful and useful in some advanced scenarios, for example, migrating from code that used Flask's g semi-global variable.

Technical Details: If you want to know more of the technical details you can check out the MR description #​4575.

Internal
  • 🔧 Add Striveworks sponsor. MR #​4596 by @​tiangolo.
  • 💚 Only build docs on push when on master to avoid duplicate runs from MRs. MR #​4564 by @​tiangolo.
  • 👥 Update FastAPI People. MR #​4502 by @​github-actions[bot].

v0.73.0

Compare Source

Features
  • ✨ Add support for declaring UploadFile parameters without explicit File(). MR #​4469 by @​tiangolo. New docs: Request Files - File Parameters with UploadFile.
  • ✨ Add support for tags with Enums. MR #​4468 by @​tiangolo. New docs: Path Operation Configuration - Tags with Enums.
  • ✨ Allow hiding from OpenAPI (and Swagger UI) Query, Cookie, Header, and Path parameters. MR #​3144 by @​astraldawn. New docs: Query Parameters and String Validations - Exclude from OpenAPI.
Docs
  • 📝 Tweak and improve docs for Request Files. MR #​4470 by @​tiangolo.
Fixes
  • 🐛 Fix bug preventing to use OpenAPI when using tuples. MR #​3874 by @​victorbenichoux.
  • 🐛 Prefer custom encoder over defaults if specified in jsonable_encoder. MR #​2061 by @​viveksunder.
    • 💚 Duplicate MR to trigger CI. MR #​4467 by @​tiangolo.
Internal
  • 🐛 Fix docs dependencies cache, to get the latest Material for MkDocs. MR #​4466 by @​tiangolo.
  • 🔧 Add sponsor Dropbase. MR #​4465 by @​tiangolo.

v0.72.0

Compare Source

Features
  • ✨ Enable configuring Swagger UI parameters. Original MR #​2568 by @​jmriebold. Here are the new docs: Configuring Swagger UI.
Docs
  • 📝 Update Python Types docs, add missing 3.6 / 3.9 example. MR #​4434 by @​tiangolo.
Translations
  • 🌐 Update Chinese translation for docs/help-fastapi.md. MR #​3847 by @​jaystone776.
  • 🌐 Fix Korean translation for docs/ko/docs/index.md. MR #​4195 by @​kty4119.
  • 🌐 Add Polish translation for docs/pl/docs/index.md. MR #​4245 by @​MicroPanda123.
  • 🌐 Add Chinese translation for docs\tutorial\path-operation-configuration.md. MR #​3312 by @​jaystone776.
Internal
  • 🔧 Enable MkDocs Material Insiders' content.tabs.link. MR #​4399 by @​tiangolo.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, click this checkbox.

This MR has been generated by Renovate Bot.

Edited Sep 12, 2022 by Kevin Morris
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: renovate/fastapi-0.x