fastapi/fastapi (fastapi)
### [`v0.65.2`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.65.2)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.65.1...0.65.2)
##### Security fixes
- π Check Content-Type request header before assuming JSON. Initial PR [#2118](https://redirect.github.com/tiangolo/fastapi/pull/2118) by [@patrickkwang](https://redirect.github.com/patrickkwang).
This change fixes a [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) security vulnerability when using cookies for authentication in path operations with JSON payloads sent by browsers.
In versions lower than `0.65.2`, FastAPI would try to read the request payload as JSON even if the `content-type` header sent was not set to `application/json` or a compatible JSON media type (e.g. `application/geo+json`).
So, a request with a content type of `text/plain` containing JSON data would be accepted and the JSON data would be extracted.
But requests with content type `text/plain` are exempt from [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) preflights, for being considered [Simple requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests). So, the browser would execute them right away including cookies, and the text content could be a JSON string that would be parsed and accepted by the FastAPI application.
See [CVE-2021-32677](https://redirect.github.com/tiangolo/fastapi/security/advisories/GHSA-8h2j-cgx8-6xv7) for more details.
Thanks to [Dima Boger](https://twitter.com/b0g3r) for the security report! ππ
##### Internal
- π§ Update sponsors badge, course bundle. PR [#3340](https://redirect.github.com/tiangolo/fastapi/pull/3340) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Add new gold sponsor Jina π. PR [#3291](https://redirect.github.com/tiangolo/fastapi/pull/3291) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://redirect.github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://redirect.github.com/tiangolo).
- π· Upgrade Issue Manager GitHub Action. PR [#3236](https://redirect.github.com/tiangolo/fastapi/pull/3236) by [@tiangolo](https://redirect.github.com/tiangolo).
### [`v0.65.1`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.65.1)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.65.0...0.65.1)
##### Security fixes
- π Upgrade pydantic pin, to handle security vulnerability [CVE-2021-29510](https://redirect.github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh). PR [#3213](https://redirect.github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://redirect.github.com/tiangolo).
### [`v0.65.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.65.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.64.0...0.65.0)
##### Breaking Changes - Upgrade
- β¬οΈ Upgrade Starlette to `0.14.2`, including internal `UJSONResponse` migrated from Starlette. This includes several bug fixes and features from Starlette. PR [#2335](https://redirect.github.com/tiangolo/fastapi/pull/2335) by [@hanneskuettner](https://redirect.github.com/hanneskuettner).
##### Translations
- π Initialize new language Polish for translations. PR [#3170](https://redirect.github.com/tiangolo/fastapi/pull/3170) by [@neternefer](https://redirect.github.com/neternefer).
##### Internal
- π· Add GitHub Action cache to speed up CI installs. PR [#3204](https://redirect.github.com/tiangolo/fastapi/pull/3204) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¬οΈ Upgrade setup-python GitHub Action to v2. PR [#3203](https://redirect.github.com/tiangolo/fastapi/pull/3203) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix docs script to generate a new translation language with `overrides` boilerplate. PR [#3202](https://redirect.github.com/tiangolo/fastapi/pull/3202) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Add new Deta banner badge with new sponsorship tier π. PR [#3194](https://redirect.github.com/tiangolo/fastapi/pull/3194) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Update FastAPI People. PR [#3189](https://redirect.github.com/tiangolo/fastapi/pull/3189) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
- π Update FastAPI People to allow better debugging. PR [#3188](https://redirect.github.com/tiangolo/fastapi/pull/3188) by [@tiangolo](https://redirect.github.com/tiangolo).
### [`v0.64.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.64.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.63.0...0.64.0)
##### Features
- β¨ Add support for adding multiple `examples` in request bodies and path, query, cookie, and header params. New docs: [Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/#body-with-multiple-examples). Initial PR [#1267](https://redirect.github.com/tiangolo/fastapi/pull/1267) by [@austinorr](https://redirect.github.com/austinorr).
##### Fixes
- π Pin SQLAlchemy range for tests, as it doesn't use SemVer. PR [#3001](https://redirect.github.com/tiangolo/fastapi/pull/3001) by [@tiangolo](https://redirect.github.com/tiangolo).
- π¨ Add newly required type annotations for mypy. PR [#2882](https://redirect.github.com/tiangolo/fastapi/pull/2882) by [@tiangolo](https://redirect.github.com/tiangolo).
- π¨ Remove internal "type: ignore", now unnecessary. PR [#2424](https://redirect.github.com/tiangolo/fastapi/pull/2424) by [@AsakuraMizu](https://redirect.github.com/AsakuraMizu).
##### Docs
- π Add link to article in Russian "FastAPI: Π·Π½Π°ΠΊΠΎΠΌΠΈΠΌΡΡ Ρ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠΎΠΌ". PR [#2564](https://redirect.github.com/tiangolo/fastapi/pull/2564) by [@trkohler](https://redirect.github.com/trkohler).
- π Add external link to blog post "Authenticate Your FastAPI App with Auth0". PR [#2172](https://redirect.github.com/tiangolo/fastapi/pull/2172) by [@dompatmore](https://redirect.github.com/dompatmore).
- π Fix broken link to article: Machine learning model serving in Python using FastAPI and Streamlit. PR [#2557](https://redirect.github.com/tiangolo/fastapi/pull/2557) by [@davidefiocco](https://redirect.github.com/davidefiocco).
- π Add FastAPI Medium Article: Deploy a dockerized FastAPI application to AWS. PR [#2515](https://redirect.github.com/tiangolo/fastapi/pull/2515) by [@vjanz](https://redirect.github.com/vjanz).
- β Fix typo in Tutorial - Handling Errors. PR [#2486](https://redirect.github.com/tiangolo/fastapi/pull/2486) by [@johnthagen](https://redirect.github.com/johnthagen).
- β Fix typo in Security OAuth2 scopes. PR [#2407](https://redirect.github.com/tiangolo/fastapi/pull/2407) by [@jugmac00](https://redirect.github.com/jugmac00).
- β Fix typo/clarify docs for SQL (Relational) Databases. PR [#2393](https://redirect.github.com/tiangolo/fastapi/pull/2393) by [@kangni](https://redirect.github.com/kangni).
- π Add external link to "FastAPI for Flask Users". PR [#2280](https://redirect.github.com/tiangolo/fastapi/pull/2280) by [@amitness](https://redirect.github.com/amitness).
##### Translations
- π Fix Chinese translation of Tutorial - Query Parameters, remove obsolete content. PR [#3051](https://redirect.github.com/tiangolo/fastapi/pull/3051) by [@louis70109](https://redirect.github.com/louis70109).
- π Add French translation for Tutorial - Background Tasks. PR [#3098](https://redirect.github.com/tiangolo/fastapi/pull/3098) by [@Smlep](https://redirect.github.com/Smlep).
- π Fix Korean translation for docs/ko/docs/index.md. PR [#3159](https://redirect.github.com/tiangolo/fastapi/pull/3159) by [@SueNaEunYang](https://redirect.github.com/SueNaEunYang).
- π Add Korean translation for Tutorial - Query Parameters. PR [#2390](https://redirect.github.com/tiangolo/fastapi/pull/2390) by [@hard-coders](https://redirect.github.com/hard-coders).
- π Add French translation for FastAPI People. PR [#2232](https://redirect.github.com/tiangolo/fastapi/pull/2232) by [@JulianMaurin](https://redirect.github.com/JulianMaurin).
- π Add Korean translation for Tutorial - Path Parameters. PR [#2355](https://redirect.github.com/tiangolo/fastapi/pull/2355) by [@hard-coders](https://redirect.github.com/hard-coders).
- π Add French translation for Features. PR [#2157](https://redirect.github.com/tiangolo/fastapi/pull/2157) by [@Jefidev](https://redirect.github.com/Jefidev).
- π₯ Update FastAPI People. PR [#3031](https://redirect.github.com/tiangolo/fastapi/pull/3031) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
- π Add Chinese translation for Tutorial - Debugging. PR [#2737](https://redirect.github.com/tiangolo/fastapi/pull/2737) by [@blt232018](https://redirect.github.com/blt232018).
- π Add Chinese translation for Tutorial - Security - OAuth2 with Password (and hashing), Bearer with JWT tokens. PR [#2642](https://redirect.github.com/tiangolo/fastapi/pull/2642) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Korean translation for Tutorial - Header Parameters. PR [#2589](https://redirect.github.com/tiangolo/fastapi/pull/2589) by [@mode9](https://redirect.github.com/mode9).
- π Add Chinese translation for Tutorial - Metadata and Docs URLs. PR [#2559](https://redirect.github.com/tiangolo/fastapi/pull/2559) by [@blt232018](https://redirect.github.com/blt232018).
- π Add Korean translation for Tutorial - First Steps. PR [#2323](https://redirect.github.com/tiangolo/fastapi/pull/2323) by [@hard-coders](https://redirect.github.com/hard-coders).
- π Add Chinese translation for Tutorial - CORS (Cross-Origin Resource Sharing). PR [#2540](https://redirect.github.com/tiangolo/fastapi/pull/2540) by [@blt232018](https://redirect.github.com/blt232018).
- π Add Chinese translation for Tutorial - Middleware. PR [#2334](https://redirect.github.com/tiangolo/fastapi/pull/2334) by [@lpdswing](https://redirect.github.com/lpdswing).
- π Add Korean translation for Tutorial - Intro. PR [#2317](https://redirect.github.com/tiangolo/fastapi/pull/2317) by [@hard-coders](https://redirect.github.com/hard-coders).
- π Add Chinese translation for Tutorial - Bigger Applications - Multiple Files. PR [#2453](https://redirect.github.com/tiangolo/fastapi/pull/2453) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Chinese translation for Tutorial - Security - Security Intro. PR [#2443](https://redirect.github.com/tiangolo/fastapi/pull/2443) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Chinese translation for Tutorial - Header Parameters. PR [#2412](https://redirect.github.com/tiangolo/fastapi/pull/2412) by [@maoyibo](https://redirect.github.com/maoyibo).
- π Add Chinese translation for Tutorial - Extra Data Types. PR [#2410](https://redirect.github.com/tiangolo/fastapi/pull/2410) by [@maoyibo](https://redirect.github.com/maoyibo).
- π Add Japanese translation for Deployment - Docker. PR [#2312](https://redirect.github.com/tiangolo/fastapi/pull/2312) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Deployment - Versions. PR [#2310](https://redirect.github.com/tiangolo/fastapi/pull/2310) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Chinese translation for Tutorial - Cookie Parameters. PR [#2261](https://redirect.github.com/tiangolo/fastapi/pull/2261) by [@alicrazy1947](https://redirect.github.com/alicrazy1947).
- π Add Japanese translation for Tutorial - Static files. PR [#2260](https://redirect.github.com/tiangolo/fastapi/pull/2260) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Tutorial - Testing. PR [#2259](https://redirect.github.com/tiangolo/fastapi/pull/2259) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Tutorial - Debugging. PR [#2256](https://redirect.github.com/tiangolo/fastapi/pull/2256) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Tutorial - Middleware. PR [#2255](https://redirect.github.com/tiangolo/fastapi/pull/2255) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Concurrency and async / await. PR [#2058](https://redirect.github.com/tiangolo/fastapi/pull/2058) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Chinese translation for Tutorial - Security - Simple OAuth2 with Password and Bearer. PR [#2514](https://redirect.github.com/tiangolo/fastapi/pull/2514) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Japanese translation for Deployment - Deta. PR [#2314](https://redirect.github.com/tiangolo/fastapi/pull/2314) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Chinese translation for Tutorial - Security - Get Current User. PR [#2474](https://redirect.github.com/tiangolo/fastapi/pull/2474) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Japanese translation for Deployment - Manually. PR [#2313](https://redirect.github.com/tiangolo/fastapi/pull/2313) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Deployment - Intro. PR [#2309](https://redirect.github.com/tiangolo/fastapi/pull/2309) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for FastAPI People. PR [#2254](https://redirect.github.com/tiangolo/fastapi/pull/2254) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Advanced - Path Operation Advanced Configuration. PR [#2124](https://redirect.github.com/tiangolo/fastapi/pull/2124) by [@Attsun1031](https://redirect.github.com/Attsun1031).
- π Add Japanese translation for External Links. PR [#2070](https://redirect.github.com/tiangolo/fastapi/pull/2070) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Tutorial - Body - Updates. PR [#1956](https://redirect.github.com/tiangolo/fastapi/pull/1956) by [@SwftAlpc](https://redirect.github.com/SwftAlpc).
- π Add Japanese translation for Tutorial - Form Data. PR [#1943](https://redirect.github.com/tiangolo/fastapi/pull/1943) by [@SwftAlpc](https://redirect.github.com/SwftAlpc).
- π Add Japanese translation for Tutorial - Cookie Parameters. PR [#1933](https://redirect.github.com/tiangolo/fastapi/pull/1933) by [@SwftAlpc](https://redirect.github.com/SwftAlpc).
##### Internal
- π§ Update top banner, point to newsletter. PR [#3003](https://redirect.github.com/tiangolo/fastapi/pull/3003) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Disable sponsor WeTransfer. PR [#3002](https://redirect.github.com/tiangolo/fastapi/pull/3002) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Update FastAPI People. PR [#2880](https://redirect.github.com/tiangolo/fastapi/pull/2880) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
- π₯ Update FastAPI People. PR [#2739](https://redirect.github.com/tiangolo/fastapi/pull/2739) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
- π§ Add new Gold Sponsor Talk Python π. PR [#2673](https://redirect.github.com/tiangolo/fastapi/pull/2673) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Add new Gold Sponsor vim.so π. PR [#2669](https://redirect.github.com/tiangolo/fastapi/pull/2669) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Add FastAPI user survey banner. PR [#2623](https://redirect.github.com/tiangolo/fastapi/pull/2623) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Add new Bronze Sponsor(s) π₯π. PR [#2622](https://redirect.github.com/tiangolo/fastapi/pull/2622) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Update social links: add Discord, fix GitHub. PR [#2621](https://redirect.github.com/tiangolo/fastapi/pull/2621) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Update FastAPI People GitHub Sponsors order. PR [#2620](https://redirect.github.com/tiangolo/fastapi/pull/2620) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Update InvestSuite sponsor data. PR [#2608](https://redirect.github.com/tiangolo/fastapi/pull/2608) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Update FastAPI People. PR [#2590](https://redirect.github.com/tiangolo/fastapi/pull/2590) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
### [`v0.63.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.63.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.62.0...0.63.0)
##### Features
- β¨ Improve type annotations, add support for mypy --strict, internally and for external packages. PR [#2547](https://redirect.github.com/tiangolo/fastapi/pull/2547) by [@tiangolo](https://redirect.github.com/tiangolo).
##### Breaking changes
- β¬οΈ Upgrade Uvicorn when installing `fastapi[all]` to the latest version including `uvloop`, the new range is `uvicorn[standard] >=0.12.0,<0.14.0`. PR [#2548](https://redirect.github.com/tiangolo/fastapi/pull/2548) by [@tiangolo](https://redirect.github.com/tiangolo).
##### Fixes
- π PR [#2547](https://redirect.github.com/tiangolo/fastapi/pull/2547) (read above) also fixes some false-positive mypy errors with `callbacks` parameters and when using the `OAuth2` class.
##### Docs
- π Update Uvicorn installation instructions to use uvicorn\[standard] (includes uvloop). PR [#2543](https://redirect.github.com/tiangolo/fastapi/pull/2543) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Update title for Deta tutorial. PR [#2466](https://redirect.github.com/tiangolo/fastapi/pull/2466) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Update FastAPI People. PR [#2454](https://redirect.github.com/tiangolo/fastapi/pull/2454) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
##### Translations
- π Add docs lang selector widget. PR [#2542](https://redirect.github.com/tiangolo/fastapi/pull/2542) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Add Chinese translation for Tutorial - Response Status Code. PR [#2442](https://redirect.github.com/tiangolo/fastapi/pull/2442) by [@waynerv](https://redirect.github.com/waynerv).
- π Start translation of the documentation for the Albanian language. PR [#2516](https://redirect.github.com/tiangolo/fastapi/pull/2516) by [@vjanz](https://redirect.github.com/vjanz).
- π Add Chinese translation for Tutorial - Extra Models. PR [#2416](https://redirect.github.com/tiangolo/fastapi/pull/2416) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Chinese translation for Tutorial - Response Model. PR [#2414](https://redirect.github.com/tiangolo/fastapi/pull/2414) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Chinese translation for Tutorial - Schema Extra Example. PR [#2411](https://redirect.github.com/tiangolo/fastapi/pull/2411) by [@maoyibo](https://redirect.github.com/maoyibo).
- π Add Korean translation for Index. PR [#2192](https://redirect.github.com/tiangolo/fastapi/pull/2192) by [@hard-coders](https://redirect.github.com/hard-coders).
- π Add Japanese translation for Advanced User Guide - Additional Status Codes. PR [#2145](https://redirect.github.com/tiangolo/fastapi/pull/2145) by [@Attsun1031](https://redirect.github.com/Attsun1031).
##### Internal
- π Fix docs overrides directory for translations. PR [#2541](https://redirect.github.com/tiangolo/fastapi/pull/2541) by [@tiangolo](https://redirect.github.com/tiangolo).
- β Remove Typer as a docs building dependency (covered by typer-cli) to fix pip resolver conflicts. PR [#2539](https://redirect.github.com/tiangolo/fastapi/pull/2539) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Add newsletter: FastAPI and friends. PR [#2509](https://redirect.github.com/tiangolo/fastapi/pull/2509) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Add new Gold Sponsor: InvestSuite π. PR [#2508](https://redirect.github.com/tiangolo/fastapi/pull/2508) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Add issue template configs. PR [#2476](https://redirect.github.com/tiangolo/fastapi/pull/2476) by [@tiangolo](https://redirect.github.com/tiangolo).
### [`v0.62.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.62.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.61.2...0.62.0)
##### Features
- β¨ Add support for shared/top-level parameters (dependencies, tags, etc). PR [#2434](https://redirect.github.com/tiangolo/fastapi/pull/2434) by [@tiangolo](https://redirect.github.com/tiangolo).
Up to now, for several options, the only way to apply them to a group of *path operations* was in `include_router`. That works well, but the call to `app.include_router()` or `router.include_router()` is normally done in another file.
That means that, for example, to apply authentication to all the *path operations* in a router it would end up being done in a different file, instead of keeping related logic together.
Setting options in `include_router` still makes sense in some cases, for example, to override or increase configurations from a third party router included in an app. But in a router that is part of a bigger application, it would probably make more sense to add those settings when creating the `APIRouter`.
**In `FastAPI`**
This allows setting the (mostly new) parameters (additionally to the already existing parameters):
- `default_response_class`: updated to handle defaults in `APIRouter` and `include_router`.
- `dependencies`: to include β¨ top-level dependencies β¨ that apply to the whole application. E.g. to add global authentication.
- `callbacks`: OpenAPI callbacks that apply to all the *path operations*.
- `deprecated`: to mark all the *path operations* as deprecated. π€·
- `include_in_schema`: to allow excluding all the *path operations* from the OpenAPI schema.
- `responses`: OpenAPI responses that apply to all the *path operations*.
For example:
```Python
from fastapi import FastAPI, Depends
async def some_dependency():
return
app = FastAPI(dependencies=[Depends(some_dependency)])
```
**In `APIRouter`**
This allows setting the (mostly new) parameters (additionally to the already existing parameters):
- `default_response_class`: updated to handle defaults in `APIRouter` and `include_router`. For example, it's not needed to set it explicitly when [creating callbacks](https://fastapi.tiangolo.com/advanced/openapi-callbacks/).
- `dependencies`: to include β¨ router-level dependencies β¨ that apply to all the *path operations* in a router. Up to now, this was only possible with `include_router`.
- `callbacks`: OpenAPI callbacks that apply to all the *path operations* in this router.
- `deprecated`: to mark all the *path operations* in a router as deprecated.
- `include_in_schema`: to allow excluding all the *path operations* in a router from the OpenAPI schema.
- `responses`: OpenAPI responses that apply to all the *path operations* in a router.
- `prefix`: to set the path prefix for a router. Up to now, this was only possible when calling `include_router`.
- `tags`: OpenAPI tags to apply to all the *path operations* in this router.
For example:
```Python
from fastapi import APIRouter, Depends
async def some_dependency():
return
router = APIRouter(prefix="/users", dependencies=[Depends(some_dependency)])
```
**In `include_router`**
Most of these settings are now supported in `APIRouter`, which normally lives closer to the related code, so it is recommended to use `APIRouter` when possible.
But `include_router` is still useful to, for example, adding options (like `dependencies`, `prefix`, and `tags`) when including a third party router, or a generic router that is shared between several projects.
This PR allows setting the (mostly new) parameters (additionally to the already existing parameters):
- `default_response_class`: updated to handle defaults in `APIRouter` and `FastAPI`.
- `deprecated`: to mark all the *path operations* in a router as deprecated in OpenAPI.
- `include_in_schema`: to allow disabling all the *path operations* from showing in the OpenAPI schema.
- `callbacks`: OpenAPI callbacks that apply to all the *path operations* in this router.
Note: all the previous parameters are still there, so it's still possible to declare `dependencies` in `include_router`.
##### Breaking Changes
- PR [#2434](https://redirect.github.com/tiangolo/fastapi/pull/2434) includes several improvements that shouldn't affect normal use cases, but could affect in advanced scenarios:
- If you are testing the generated OpenAPI (you shouldn't, FastAPI already tests it extensively for you): the order for `tags` in `include_router` and *path operations* was updated for consistency, but it's a simple order change.
- If you have advanced custom logic to access each route's `route.response_class`, or the `router.default_response_class`, or the `app.default_response_class`: the default value for `response_class` in `APIRoute` and for `default_response_class` in `APIRouter` and `FastAPI` is now a `DefaultPlaceholder` used internally to handle and solve default values and overrides. The actual response class inside the `DefaultPlaceholder` is available at `route.response_class.value`.
##### Docs
- PR [#2434](https://redirect.github.com/tiangolo/fastapi/pull/2434) (above) includes new or updated docs:
- Advanced User Guide - OpenAPI Callbacks.
- Tutorial - Bigger Applications.
- Tutorial - Dependencies - Dependencies in path operation decorators.
- Tutorial - Dependencies - Global Dependencies.
- π Add FastAPI monitoring blog post to External Links. PR [#2324](https://redirect.github.com/tiangolo/fastapi/pull/2324) by [@louisguitton](https://redirect.github.com/louisguitton).
- βοΈ Fix typo in Deta tutorial. PR [#2320](https://redirect.github.com/tiangolo/fastapi/pull/2320) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Add Discord chat. PR [#2322](https://redirect.github.com/tiangolo/fastapi/pull/2322) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix image links for sponsors. PR [#2304](https://redirect.github.com/tiangolo/fastapi/pull/2304) by [@tiangolo](https://redirect.github.com/tiangolo).
##### Translations
- π Add Japanese translation for Advanced - Custom Response. PR [#2193](https://redirect.github.com/tiangolo/fastapi/pull/2193) by [@Attsun1031](https://redirect.github.com/Attsun1031).
- π Add Chinese translation for Benchmarks. PR [#2119](https://redirect.github.com/tiangolo/fastapi/pull/2119) by [@spaceack](https://redirect.github.com/spaceack).
- π Add Chinese translation for Tutorial - Body - Nested Models. PR [#1609](https://redirect.github.com/tiangolo/fastapi/pull/1609) by [@waynerv](https://redirect.github.com/waynerv).
- π Add Chinese translation for Advanced - Custom Response. PR [#1459](https://redirect.github.com/tiangolo/fastapi/pull/1459) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu).
- π Add Chinese translation for Advanced - Return a Response Directly. PR [#1452](https://redirect.github.com/tiangolo/fastapi/pull/1452) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu).
- π Add Chinese translation for Advanced - Additional Status Codes. PR [#1451](https://redirect.github.com/tiangolo/fastapi/pull/1451) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu).
- π Add Chinese translation for Advanced - Path Operation Advanced Configuration. PR [#1447](https://redirect.github.com/tiangolo/fastapi/pull/1447) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu).
- π Add Chinese translation for Advanced User Guide - Intro. PR [#1445](https://redirect.github.com/tiangolo/fastapi/pull/1445) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu).
##### Internal
- π§ Update TestDriven link to course in sponsors section. PR [#2435](https://redirect.github.com/tiangolo/fastapi/pull/2435) by [@tiangolo](https://redirect.github.com/tiangolo).
- π± Update sponsor logos. PR [#2418](https://redirect.github.com/tiangolo/fastapi/pull/2418) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix disabling install of Material for MkDocs Insiders in forks, strike 1 βΎ. PR [#2340](https://redirect.github.com/tiangolo/fastapi/pull/2340) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix disabling Material for MkDocs Insiders install in forks. PR [#2339](https://redirect.github.com/tiangolo/fastapi/pull/2339) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Add silver sponsor WeTransfer. PR [#2338](https://redirect.github.com/tiangolo/fastapi/pull/2338) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Set up and enable Material for MkDocs Insiders for the docs. PR [#2325](https://redirect.github.com/tiangolo/fastapi/pull/2325) by [@tiangolo](https://redirect.github.com/tiangolo).
### [`v0.61.2`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.61.2)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.61.1...0.61.2)
##### Fixes
- π Relax Swagger UI version pin. PR [#2089](https://redirect.github.com/tiangolo/fastapi/pull/2089) by [@jmriebold](https://redirect.github.com/jmriebold).
- π Fix bug overriding custom HTTPException and RequestValidationError from exception_handlers. PR [#1924](https://redirect.github.com/tiangolo/fastapi/pull/1924) by [@uriyyo](https://redirect.github.com/uriyyo).
- βοΈ Fix typo on dependencies utils and cleanup unused variable. PR [#1912](https://redirect.github.com/tiangolo/fastapi/pull/1912) by [@Kludex](https://redirect.github.com/Kludex).
##### Docs
- βοΈ Fix typo in Tutorial - Path Parameters. PR [#2231](https://redirect.github.com/tiangolo/fastapi/pull/2231) by [@mariacamilagl](https://redirect.github.com/mariacamilagl).
- β Fix a stylistic error in docs. PR [#2206](https://redirect.github.com/tiangolo/fastapi/pull/2206) by [@ddobrinskiy](https://redirect.github.com/ddobrinskiy).
- β Fix capitalizaiton typo in docs. PR [#2204](https://redirect.github.com/tiangolo/fastapi/pull/2204) by [@imba-tjd](https://redirect.github.com/imba-tjd).
- β Fix typo in docs. PR [#2179](https://redirect.github.com/tiangolo/fastapi/pull/2179) by [@ammarasmro](https://redirect.github.com/ammarasmro).
- π Update/fix links in docs to use HTTPS. PR [#2165](https://redirect.github.com/tiangolo/fastapi/pull/2165) by [@imba-tjd](https://redirect.github.com/imba-tjd).
- β Fix typos and add rewording in docs. PR [#2159](https://redirect.github.com/tiangolo/fastapi/pull/2159) by [@nukopy](https://redirect.github.com/nukopy).
- π Fix code consistency in examples for Tutorial - User Guide - Path Parameters. PR [#2158](https://redirect.github.com/tiangolo/fastapi/pull/2158) by [@nukopy](https://redirect.github.com/nukopy).
- π Fix renamed parameter `content_type` typo. PR [#2135](https://redirect.github.com/tiangolo/fastapi/pull/2135) by [@TeoZosa](https://redirect.github.com/TeoZosa).
- β Fix minor typos in docs. PR [#2122](https://redirect.github.com/tiangolo/fastapi/pull/2122) by [@TeoZosa](https://redirect.github.com/TeoZosa).
- β Fix typos in docs and source examples. PR [#2102](https://redirect.github.com/tiangolo/fastapi/pull/2102) by [@AdrianDeAnda](https://redirect.github.com/AdrianDeAnda).
- β Fix incorrect Celery URLs in docs. PR [#2100](https://redirect.github.com/tiangolo/fastapi/pull/2100) by [@CircleOnCircles](https://redirect.github.com/CircleOnCircles).
- π Simplify intro to Python Types, all currently supported Python versions include type hints π. PR [#2085](https://redirect.github.com/tiangolo/fastapi/pull/2085) by [@ninjaaron](https://redirect.github.com/ninjaaron).
- π Fix example code with sets in Tutorial - Body - Nested Models 3. PR [#2054](https://redirect.github.com/tiangolo/fastapi/pull/2054) by [@hitrust](https://redirect.github.com/hitrust).
- π Fix example code with sets in Tutorial - Body - Nested Models 2. PR [#2053](https://redirect.github.com/tiangolo/fastapi/pull/2053) by [@hitrust](https://redirect.github.com/hitrust).
- π Fix example code with sets in Tutorial - Body - Nested Models. PR [#2052](https://redirect.github.com/tiangolo/fastapi/pull/2052) by [@hitrust](https://redirect.github.com/hitrust).
- β Fix typo in Benchmarks. PR [#1995](https://redirect.github.com/tiangolo/fastapi/pull/1995) by [@AlejoAsd](https://redirect.github.com/AlejoAsd).
- π Add note in CORS tutorial about allow_origins with \["\*"] and allow_credentials. PR [#1895](https://redirect.github.com/tiangolo/fastapi/pull/1895) by [@dsmurrell](https://redirect.github.com/dsmurrell).
- π Add deployment to Deta, the first gold sponsor π. PR [#2303](https://redirect.github.com/tiangolo/fastapi/pull/2303) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Update FastAPI People. PR [#2282](https://redirect.github.com/tiangolo/fastapi/pull/2282) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
- βοΈ Fix uppercase in Tutorial - Query parameters. PR [#2245](https://redirect.github.com/tiangolo/fastapi/pull/2245) by [@mariacamilagl](https://redirect.github.com/mariacamilagl).
- π Add articles to External Links. PR [#2247](https://redirect.github.com/tiangolo/fastapi/pull/2247) by [@tiangolo](https://redirect.github.com/tiangolo).
- β Fix typo in Spanish tutorial index. PR [#2020](https://redirect.github.com/tiangolo/fastapi/pull/2020) by [@aviloncho](https://redirect.github.com/aviloncho).
##### Translations
- π Add Japanese translation for Advanced Tutorial - Response Directly. PR [#2191](https://redirect.github.com/tiangolo/fastapi/pull/2191) by [@Attsun1031](https://redirect.github.com/Attsun1031).
- π Add Japanese translation for Tutorial - Security - First Steps. PR [#2153](https://redirect.github.com/tiangolo/fastapi/pull/2153) by [@komtaki](https://redirect.github.com/komtaki).
- π Add Japanese translation for Tutorial - Query Parameters and String Validations. PR [#1901](https://redirect.github.com/tiangolo/fastapi/pull/1901) by [@SwftAlpc](https://redirect.github.com/SwftAlpc).
- π Add Portuguese translation for External Links. PR [#1443](https://redirect.github.com/tiangolo/fastapi/pull/1443) by [@Serrones](https://redirect.github.com/Serrones).
- π Add Japanese translation for Tutorial - CORS. PR [#2125](https://redirect.github.com/tiangolo/fastapi/pull/2125) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Contributing. PR [#2067](https://redirect.github.com/tiangolo/fastapi/pull/2067) by [@komtaki](https://redirect.github.com/komtaki).
- π Add Japanese translation for Project Generation. PR [#2050](https://redirect.github.com/tiangolo/fastapi/pull/2050) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Alternatives. PR [#2043](https://redirect.github.com/tiangolo/fastapi/pull/2043) by [@Attsun1031](https://redirect.github.com/Attsun1031).
- π Add Japanese translation for History Design and Future. PR [#2002](https://redirect.github.com/tiangolo/fastapi/pull/2002) by [@komtaki](https://redirect.github.com/komtaki).
- π Add Japanese translation for Benchmarks. PR [#1992](https://redirect.github.com/tiangolo/fastapi/pull/1992) by [@komtaki](https://redirect.github.com/komtaki).
- π Add Japanese translation for Tutorial - Header Parameters. PR [#1935](https://redirect.github.com/tiangolo/fastapi/pull/1935) by [@SwftAlpc](https://redirect.github.com/SwftAlpc).
- π Add Portuguese translation for Tutorial - First Steps. PR [#1861](https://redirect.github.com/tiangolo/fastapi/pull/1861) by [@jessicapaz](https://redirect.github.com/jessicapaz).
- π Add Portuguese translation for Python Types. PR [#1796](https://redirect.github.com/tiangolo/fastapi/pull/1796) by [@izaguerreiro](https://redirect.github.com/izaguerreiro).
- π Add Japanese translation for Help FastAPI. PR [#1692](https://redirect.github.com/tiangolo/fastapi/pull/1692) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Tutorial - Body. PR [#1683](https://redirect.github.com/tiangolo/fastapi/pull/1683) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for Tutorial - Query Params. PR [#1674](https://redirect.github.com/tiangolo/fastapi/pull/1674) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for tutorial/path-params.md. PR [#1671](https://redirect.github.com/tiangolo/fastapi/pull/1671) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for tutorial/first-steps.md. PR [#1658](https://redirect.github.com/tiangolo/fastapi/pull/1658) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add Japanese translation for tutorial/index.md. PR [#1656](https://redirect.github.com/tiangolo/fastapi/pull/1656) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Add translation to Portuguese for Project Generation. PR [#1602](https://redirect.github.com/tiangolo/fastapi/pull/1602) by [@Serrones](https://redirect.github.com/Serrones).
- π Add Japanese translation for Features. PR [#1625](https://redirect.github.com/tiangolo/fastapi/pull/1625) by [@tokusumi](https://redirect.github.com/tokusumi).
- π Initialize new language Korean for translations. PR [#2018](https://redirect.github.com/tiangolo/fastapi/pull/2018) by [@hard-coders](https://redirect.github.com/hard-coders).
- π Add Portuguese translation of Deployment. PR [#1374](https://redirect.github.com/tiangolo/fastapi/pull/1374) by [@Serrones](https://redirect.github.com/Serrones).
##### Internal
- π₯ Cleanup after upgrade for Docs Previews GitHub Action. PR [#2248](https://redirect.github.com/tiangolo/fastapi/pull/2248) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix CI docs preview, unzip docs. PR [#2246](https://redirect.github.com/tiangolo/fastapi/pull/2246) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¨ Add instant docs deploy previews for PRs from forks. PR [#2244](https://redirect.github.com/tiangolo/fastapi/pull/2244) by [@tiangolo](https://redirect.github.com/tiangolo).
- β‘οΈ Build docs for languages in parallel in subprocesses to speed up CI. PR [#2242](https://redirect.github.com/tiangolo/fastapi/pull/2242) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix docs order generation for partial translations. PR [#2238](https://redirect.github.com/tiangolo/fastapi/pull/2238) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Update FastAPI People. PR [#2202](https://redirect.github.com/tiangolo/fastapi/pull/2202) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions).
- β»οΈ Update FastAPI People GitHub Action to send the PR as github-actions. PR [#2201](https://redirect.github.com/tiangolo/fastapi/pull/2201) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Update FastAPI People GitHub Action config, run monthly. PR [#2199](https://redirect.github.com/tiangolo/fastapi/pull/2199) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix FastAPI People GitHub Action Docker dependency, strike 1 βΎ. PR [#2198](https://redirect.github.com/tiangolo/fastapi/pull/2198) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix FastAPI People GitHub Action Docker dependencies. PR [#2197](https://redirect.github.com/tiangolo/fastapi/pull/2197) by [@tiangolo](https://redirect.github.com/tiangolo).
- π Fix FastAPI People GitHub Action when there's nothing to change. PR [#2196](https://redirect.github.com/tiangolo/fastapi/pull/2196) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Add new section FastAPI People. PR [#2195](https://redirect.github.com/tiangolo/fastapi/pull/2195) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¬οΈ Upgrade GitHub Action Latest Changes. PR [#2190](https://redirect.github.com/tiangolo/fastapi/pull/2190) by [@tiangolo](https://redirect.github.com/tiangolo).
- β¬οΈ Upgrade GitHub Action Label Approved. PR [#2189](https://redirect.github.com/tiangolo/fastapi/pull/2189) by [@tiangolo](https://redirect.github.com/tiangolo).
- π§ Update GitHub Action Label Approved, run at 12:00. PR [#2185](https://redirect.github.com/tiangolo/fastapi/pull/2185) by [@tiangolo](https://redirect.github.com/tiangolo).
- π· Upgrade GitHub Action Latest Changes. PR [#2184](https://redirect.github.com/tiangolo/fastapi/pull/2184) by [@tiangolo](https://redirect.github.com/tiangolo).
- π· Set GitHub Action Label Approved to run daily, not every minute. PR [#2163](https://redirect.github.com/tiangolo/fastapi/pull/2163) by [@tiangolo](https://redirect.github.com/tiangolo).
- π₯ Remove pr-approvals GitHub Action as it's not compatible with forks. Use the new one. PR [#2162](https://redirect.github.com/tiangolo/fastapi/pull/2162) by [@tiangolo](https://redirect.github.com/tiangolo).
- π· Add GitHub Action Latest Changes. PR [#2160](https://redirect.github.com/tiangolo/fastapi/pull/2160).
- π· Add GitHub Action Label Approved. PR [#2161](https://redirect.github.com/tiangolo/fastapi/pull/2161).
### [`v0.61.1`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.61.1)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.61.0...0.61.1)
##### Fixes
- Fix issues using `jsonable_encoder` with SQLAlchemy models directly. PR [#1987](https://redirect.github.com/tiangolo/fastapi/pull/1987).
##### Docs
- Fix typo in NoSQL docs. PR [#1980](https://redirect.github.com/tiangolo/fastapi/pull/1980) by [@facundojmaero](https://redirect.github.com/facundojmaero).
##### Translations
- Add translation for [main page to Japanese](https://fastapi.tiangolo.com/ja/) PR [#1571](https://redirect.github.com/tiangolo/fastapi/pull/1571) by [@ryuckel](https://redirect.github.com/ryuckel).
- Initialize French translations. PR [#1975](https://redirect.github.com/tiangolo/fastapi/pull/1975) by [@JulianMaurin-BM](https://redirect.github.com/JulianMaurin-BM).
- Initialize Turkish translations. PR [#1905](https://redirect.github.com/tiangolo/fastapi/pull/1905) by [@ycd](https://redirect.github.com/ycd).
##### Internal
- Improve docs maintainability by updating `hl_lines` syntax to use ranges. PR [#1863](https://redirect.github.com/tiangolo/fastapi/pull/1863) by [@la-mar](https://redirect.github.com/la-mar).
### [`v0.61.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.61.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.60.2...0.61.0)
##### Features
- Add support for injecting `HTTPConnection` (as `Request` and `WebSocket`). Useful for sharing app state in dependencies. PR [#1827](https://redirect.github.com/tiangolo/fastapi/pull/1827) by [@nsidnev](https://redirect.github.com/nsidnev).
- Export `WebSocketDisconnect` and add example handling WebSocket disconnections to docs. PR [#1822](https://redirect.github.com/tiangolo/fastapi/pull/1822) by [@rkbeatss](https://redirect.github.com/rkbeatss).
##### Breaking Changes
- Require Pydantic > `1.0.0`.
- Remove support for deprecated Pydantic `0.32.2`. This improves maintainability and allows new features.
- In `FastAPI` and `APIRouter`:
- Remove *path operation decorators* related/deprecated parameter `response_model_skip_defaults` (use `response_model_exclude_unset` instead).
- Change *path operation decorators* parameter default for `response_model_exclude` from `set()` to `None` (as is in Pydantic).
- In `encoders.jsonable_encoder`:
- Remove deprecated `skip_defaults`, use instead `exclude_unset`.
- Set default of `exclude` from `set()` to `None` (as is in Pydantic).
- PR [#1862](https://redirect.github.com/tiangolo/fastapi/pull/1862).
- In `encoders.jsonable_encoder` remove parameter `sqlalchemy_safe`.
- It was an early hack to allow returning SQLAlchemy models, but it was never documented, and the recommended way is using Pydantic's `orm_mode` as described in the tutorial: [SQL (Relational) Databases](https://fastapi.tiangolo.com/tutorial/sql-databases/).
- PR [#1864](https://redirect.github.com/tiangolo/fastapi/pull/1864).
##### Docs
- Add link to the course by TestDriven.io: [Test-Driven Development with FastAPI and Docker](https://testdriven.io/courses/tdd-fastapi/). PR [#1860](https://redirect.github.com/tiangolo/fastapi/pull/1860).
- Fix empty log message in docs example about handling errors. PR [#1815](https://redirect.github.com/tiangolo/fastapi/pull/1815) by [@manlix](https://redirect.github.com/manlix).
- Reword text to reduce ambiguity while not being gender-specific. PR [#1824](https://redirect.github.com/tiangolo/fastapi/pull/1824) by [@Mause](https://redirect.github.com/Mause).
##### Internal
- Add Flake8 linting. Original PR [#1774](https://redirect.github.com/tiangolo/fastapi/pull/1774) by [@MashhadiNima](https://redirect.github.com/MashhadiNima).
- Disable Gitter bot, as it's currently broken, and Gitter's response doesn't show the problem. PR [#1853](https://redirect.github.com/tiangolo/fastapi/pull/1853).
### [`v0.60.2`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.60.2)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.60.1...0.60.2)
- Fix typo in docs for query parameters. PR [#1832](https://redirect.github.com/tiangolo/fastapi/pull/1832) by [@ycd](https://redirect.github.com/ycd).
- Add docs about [Async Tests](https://fastapi.tiangolo.com/advanced/async-tests/). PR [#1619](https://redirect.github.com/tiangolo/fastapi/pull/1619) by [@empicano](https://redirect.github.com/empicano).
- Raise an exception when using form data (`Form`, `File`) without having `python-multipart` installed.
- Up to now the application would run, and raise an exception only when receiving a request with form data, the new behavior, raising early, will prevent from deploying applications with broken dependencies.
- It also detects if the correct package `python-multipart` is installed instead of the incorrect `multipart` (both importable as `multipart`).
- PR [#1851](https://redirect.github.com/tiangolo/fastapi/pull/1851) based on original PR [#1627](https://redirect.github.com/tiangolo/fastapi/pull/1627) by [@chrisngyn](https://redirect.github.com/chrisngyn), [@YKo20010](https://redirect.github.com/YKo20010), [@kx-chen](https://redirect.github.com/kx-chen).
- Re-enable Gitter releases bot. PR [#1831](https://redirect.github.com/tiangolo/fastapi/pull/1831).
- Add link to async SQL databases tutorial from main SQL tutorial. PR [#1813](https://redirect.github.com/tiangolo/fastapi/pull/1813) by [@short2strings](https://redirect.github.com/short2strings).
- Fix typo in tutorial about behind a proxy. PR [#1807](https://redirect.github.com/tiangolo/fastapi/pull/1807) by [@toidi](https://redirect.github.com/toidi).
- Fix typo in Portuguese docs. PR [#1795](https://redirect.github.com/tiangolo/fastapi/pull/1795) by [@izaguerreiro](https://redirect.github.com/izaguerreiro).
- Add translations setup for Ukrainian. PR [#1830](https://redirect.github.com/tiangolo/fastapi/pull/1830).
- Add external link [Build And Host Fast Data Science Applications Using FastAPI](https://towardsdatascience.com/build-and-host-fast-data-science-applications-using-fastapi-823be8a1d6a0). PR [#1786](https://redirect.github.com/tiangolo/fastapi/pull/1786) by [@Kludex](https://redirect.github.com/Kludex).
- Fix encoding of Pydantic models that inherit from others models with custom `json_encoders`. PR [#1769](https://redirect.github.com/tiangolo/fastapi/pull/1769) by [@henrybetts](https://redirect.github.com/henrybetts).
- Simplify and improve `jsonable_encoder`. PR [#1754](https://redirect.github.com/tiangolo/fastapi/pull/1754) by [@MashhadiNima](https://redirect.github.com/MashhadiNima).
- Simplify internal code syntax in several points. PR [#1753](https://redirect.github.com/tiangolo/fastapi/pull/1753) by [@uriyyo](https://redirect.github.com/uriyyo).
- Improve internal typing, declare `Optional` parameters. PR [#1731](https://redirect.github.com/tiangolo/fastapi/pull/1731) by [@MashhadiNima](https://redirect.github.com/MashhadiNima).
- Add external link [Deploy FastAPI on Azure App Service](https://www.tutlinks.com/deploy-fastapi-on-azure/) to docs. PR [#1726](https://redirect.github.com/tiangolo/fastapi/pull/1726) by [@windson](https://redirect.github.com/windson).
- Add link to Starlette docs about WebSocket testing. PR [#1717](https://redirect.github.com/tiangolo/fastapi/pull/1717) by [@hellocoldworld](https://redirect.github.com/hellocoldworld).
- Refactor generating dependant, merge for loops. PR [#1714](https://redirect.github.com/tiangolo/fastapi/pull/1714) by [@Bloodielie](https://redirect.github.com/Bloodielie).
- Update example for templates with Jinja to include HTML media type. PR [#1690](https://redirect.github.com/tiangolo/fastapi/pull/1690) by [@frafra](https://redirect.github.com/frafra).
- Fix typos in docs for security. PR [#1678](https://redirect.github.com/tiangolo/fastapi/pull/1678) by [@nilslindemann](https://redirect.github.com/nilslindemann).
- Fix typos in docs for dependencies. PR [#1675](https://redirect.github.com/tiangolo/fastapi/pull/1675) by [@nilslindemann](https://redirect.github.com/nilslindemann).
- Fix type annotation for `**extra` parameters in `FastAPI`. PR [#1659](https://redirect.github.com/tiangolo/fastapi/pull/1659) by [@bharel](https://redirect.github.com/bharel).
- Bump MkDocs Material to fix docs in browsers with dark mode. PR [#1789](https://redirect.github.com/tiangolo/fastapi/pull/1789) by [@adriencaccia](https://redirect.github.com/adriencaccia).
- Remove docs preview comment from each commit. PR [#1826](https://redirect.github.com/tiangolo/fastapi/pull/1826).
- Update GitHub context extraction for Gitter notification bot. PR [#1766](https://redirect.github.com/tiangolo/fastapi/pull/1766).
### [`v0.60.1`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.60.1)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.60.0...0.60.1)
- Add debugging logs for GitHub actions to introspect GitHub hidden context. PR [#1764](https://redirect.github.com/tiangolo/fastapi/pull/1764).
- Use OS preference theme for online docs. PR [#1760](https://redirect.github.com/tiangolo/fastapi/pull/1760) by [@adriencaccia](https://redirect.github.com/adriencaccia).
- Upgrade Starlette to version `0.13.6` to handle a vulnerability when using static files in Windows. PR [#1759](https://redirect.github.com/tiangolo/fastapi/pull/1759) by [@jamesag26](https://redirect.github.com/jamesag26).
- Pin Swagger UI temporarily, waiting for a fix for [swagger-api/swagger-ui#6249](https://redirect.github.com/swagger-api/swagger-ui/issues/6249). PR [#1763](https://redirect.github.com/tiangolo/fastapi/pull/1763).
- Update GitHub Actions, use commit from PR for docs preview, not commit from pre-merge. PR [#1761](https://redirect.github.com/tiangolo/fastapi/pull/1761).
- Update GitHub Actions, refactor Gitter bot. PR [#1746](https://redirect.github.com/tiangolo/fastapi/pull/1746).
### [`v0.60.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.60.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.59.0...0.60.0)
- Add GitHub Action to watch for missing preview docs and trigger a preview deploy. PR [#1740](https://redirect.github.com/tiangolo/fastapi/pull/1740).
- Add custom GitHub Action to get artifact with docs preview. PR [#1739](https://redirect.github.com/tiangolo/fastapi/pull/1739).
- Add new GitHub Actions to preview docs from PRs. PR [#1738](https://redirect.github.com/tiangolo/fastapi/pull/1738).
- Add XML test coverage to support GitHub Actions. PR [#1737](https://redirect.github.com/tiangolo/fastapi/pull/1737).
- Update badges and remove Travis now that GitHub Actions is the main CI. PR [#1736](https://redirect.github.com/tiangolo/fastapi/pull/1736).
- Add GitHub Actions for CI, move from Travis. PR [#1735](https://redirect.github.com/tiangolo/fastapi/pull/1735).
- Add support for adding OpenAPI schema for GET requests with a body. PR [#1626](https://redirect.github.com/tiangolo/fastapi/pull/1626) by [@victorphoenix3](https://redirect.github.com/victorphoenix3).
### [`v0.59.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.59.0)
[Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.58.1...0.59.0)
- Fix typo in docstring for OAuth2 utils. PR [#1621](https://redirect.github.com/tiangolo/fastapi/pull/1621) by [@tomarv2](https://redirect.github.com/tomarv2).
- Update JWT docs to use Python-jose instead of PyJWT. Initial PR [#1610](https://redirect.github.com/tiangolo/fastapi/pull/1610) by [@asheux](https://redirect.github.com/asheux).
- Fix/re-enable search bar in docs. PR [#1703](https://redirect.github.com/tiangolo/fastapi/pull/1703).
- Auto-generate a "server" in OpenAPI `servers` when there's a `root_path` instead of prefixing all the `paths`:
- Add a new parameter for `FastAPI` classes: `root_path_in_servers` to disable the auto-generation of `servers`.
- New docs about `root_path` and `servers` in [Additional Servers](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#additional-servers).
- Update OAuth2 examples to use a relative URL for `tokenUrl="token"` to make sure those examples keep working as-is even when behind a reverse proxy.
- Initial PR [#1596](https://redirect.github.com/tiangolo/fastapi/pull/1596) by [@rkbeatss](https://redirect.github.com/rkbeatss).
- Fix typo/link in External Links. PR [#1702](https://redirect.github.com/tiangolo/fastapi/pull/1702).
- Update handling of [External Links](https://fastapi.tiangolo.com/external-links/) to use a data file and allow translating the headers without becoming obsolete quickly when new links are added. PR [#https://github.com/tiangolo/fastapi/pull/1701](https://redirect.github.com/tiangolo/fastapi/pull/1701).
- Add external link [Machine learning model serving in Python using FastAPI and Streamlit](https://davidefiocco.github.io/2020/06/27/streamlit-fastapi-ml-serving.html) to docs. PR [#1669](https://redirect.github.com/tiangolo/fastapi/pull/1669) by [@davidefiocco](https://redirect.github.com/davidefiocco).
- Add note in docs on order in Pydantic Unions. PR [#1591](https://redirect.github.com/tiangolo/fastapi/pull/1591) by [@kbanc](https://redirect.github.com/kbanc).
- Improve support for tests in editor. PR [#1699](https://redirect.github.com/tiangolo/fastapi/pull/1699).
- Pin dependencies. PR [#1697](https://redirect.github.com/tiangolo/fastapi/pull/1697).
- Update isort to version 5.x.x. PR [#1670](https://redirect.github.com/tiangolo/fastapi/pull/1670) by [@asheu
This PR contains the following updates:
==0.33.0
->==0.65.2
By merging this PR, the issue #17 will be automatically resolved and closed:
Release Notes
fastapi/fastapi (fastapi)
### [`v0.65.2`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.65.2) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.65.1...0.65.2) ##### Security fixes - π Check Content-Type request header before assuming JSON. Initial PR [#2118](https://redirect.github.com/tiangolo/fastapi/pull/2118) by [@patrickkwang](https://redirect.github.com/patrickkwang). This change fixes a [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) security vulnerability when using cookies for authentication in path operations with JSON payloads sent by browsers. In versions lower than `0.65.2`, FastAPI would try to read the request payload as JSON even if the `content-type` header sent was not set to `application/json` or a compatible JSON media type (e.g. `application/geo+json`). So, a request with a content type of `text/plain` containing JSON data would be accepted and the JSON data would be extracted. But requests with content type `text/plain` are exempt from [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) preflights, for being considered [Simple requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests). So, the browser would execute them right away including cookies, and the text content could be a JSON string that would be parsed and accepted by the FastAPI application. See [CVE-2021-32677](https://redirect.github.com/tiangolo/fastapi/security/advisories/GHSA-8h2j-cgx8-6xv7) for more details. Thanks to [Dima Boger](https://twitter.com/b0g3r) for the security report! ππ ##### Internal - π§ Update sponsors badge, course bundle. PR [#3340](https://redirect.github.com/tiangolo/fastapi/pull/3340) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Add new gold sponsor Jina π. PR [#3291](https://redirect.github.com/tiangolo/fastapi/pull/3291) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://redirect.github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://redirect.github.com/tiangolo). - π· Upgrade Issue Manager GitHub Action. PR [#3236](https://redirect.github.com/tiangolo/fastapi/pull/3236) by [@tiangolo](https://redirect.github.com/tiangolo). ### [`v0.65.1`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.65.1) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.65.0...0.65.1) ##### Security fixes - π Upgrade pydantic pin, to handle security vulnerability [CVE-2021-29510](https://redirect.github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh). PR [#3213](https://redirect.github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://redirect.github.com/tiangolo). ### [`v0.65.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.65.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.64.0...0.65.0) ##### Breaking Changes - Upgrade - β¬οΈ Upgrade Starlette to `0.14.2`, including internal `UJSONResponse` migrated from Starlette. This includes several bug fixes and features from Starlette. PR [#2335](https://redirect.github.com/tiangolo/fastapi/pull/2335) by [@hanneskuettner](https://redirect.github.com/hanneskuettner). ##### Translations - π Initialize new language Polish for translations. PR [#3170](https://redirect.github.com/tiangolo/fastapi/pull/3170) by [@neternefer](https://redirect.github.com/neternefer). ##### Internal - π· Add GitHub Action cache to speed up CI installs. PR [#3204](https://redirect.github.com/tiangolo/fastapi/pull/3204) by [@tiangolo](https://redirect.github.com/tiangolo). - β¬οΈ Upgrade setup-python GitHub Action to v2. PR [#3203](https://redirect.github.com/tiangolo/fastapi/pull/3203) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix docs script to generate a new translation language with `overrides` boilerplate. PR [#3202](https://redirect.github.com/tiangolo/fastapi/pull/3202) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Add new Deta banner badge with new sponsorship tier π. PR [#3194](https://redirect.github.com/tiangolo/fastapi/pull/3194) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Update FastAPI People. PR [#3189](https://redirect.github.com/tiangolo/fastapi/pull/3189) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). - π Update FastAPI People to allow better debugging. PR [#3188](https://redirect.github.com/tiangolo/fastapi/pull/3188) by [@tiangolo](https://redirect.github.com/tiangolo). ### [`v0.64.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.64.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.63.0...0.64.0) ##### Features - β¨ Add support for adding multiple `examples` in request bodies and path, query, cookie, and header params. New docs: [Declare Request Example Data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/#body-with-multiple-examples). Initial PR [#1267](https://redirect.github.com/tiangolo/fastapi/pull/1267) by [@austinorr](https://redirect.github.com/austinorr). ##### Fixes - π Pin SQLAlchemy range for tests, as it doesn't use SemVer. PR [#3001](https://redirect.github.com/tiangolo/fastapi/pull/3001) by [@tiangolo](https://redirect.github.com/tiangolo). - π¨ Add newly required type annotations for mypy. PR [#2882](https://redirect.github.com/tiangolo/fastapi/pull/2882) by [@tiangolo](https://redirect.github.com/tiangolo). - π¨ Remove internal "type: ignore", now unnecessary. PR [#2424](https://redirect.github.com/tiangolo/fastapi/pull/2424) by [@AsakuraMizu](https://redirect.github.com/AsakuraMizu). ##### Docs - π Add link to article in Russian "FastAPI: Π·Π½Π°ΠΊΠΎΠΌΠΈΠΌΡΡ Ρ ΡΡΠ΅ΠΉΠΌΠ²ΠΎΡΠΊΠΎΠΌ". PR [#2564](https://redirect.github.com/tiangolo/fastapi/pull/2564) by [@trkohler](https://redirect.github.com/trkohler). - π Add external link to blog post "Authenticate Your FastAPI App with Auth0". PR [#2172](https://redirect.github.com/tiangolo/fastapi/pull/2172) by [@dompatmore](https://redirect.github.com/dompatmore). - π Fix broken link to article: Machine learning model serving in Python using FastAPI and Streamlit. PR [#2557](https://redirect.github.com/tiangolo/fastapi/pull/2557) by [@davidefiocco](https://redirect.github.com/davidefiocco). - π Add FastAPI Medium Article: Deploy a dockerized FastAPI application to AWS. PR [#2515](https://redirect.github.com/tiangolo/fastapi/pull/2515) by [@vjanz](https://redirect.github.com/vjanz). - β Fix typo in Tutorial - Handling Errors. PR [#2486](https://redirect.github.com/tiangolo/fastapi/pull/2486) by [@johnthagen](https://redirect.github.com/johnthagen). - β Fix typo in Security OAuth2 scopes. PR [#2407](https://redirect.github.com/tiangolo/fastapi/pull/2407) by [@jugmac00](https://redirect.github.com/jugmac00). - β Fix typo/clarify docs for SQL (Relational) Databases. PR [#2393](https://redirect.github.com/tiangolo/fastapi/pull/2393) by [@kangni](https://redirect.github.com/kangni). - π Add external link to "FastAPI for Flask Users". PR [#2280](https://redirect.github.com/tiangolo/fastapi/pull/2280) by [@amitness](https://redirect.github.com/amitness). ##### Translations - π Fix Chinese translation of Tutorial - Query Parameters, remove obsolete content. PR [#3051](https://redirect.github.com/tiangolo/fastapi/pull/3051) by [@louis70109](https://redirect.github.com/louis70109). - π Add French translation for Tutorial - Background Tasks. PR [#3098](https://redirect.github.com/tiangolo/fastapi/pull/3098) by [@Smlep](https://redirect.github.com/Smlep). - π Fix Korean translation for docs/ko/docs/index.md. PR [#3159](https://redirect.github.com/tiangolo/fastapi/pull/3159) by [@SueNaEunYang](https://redirect.github.com/SueNaEunYang). - π Add Korean translation for Tutorial - Query Parameters. PR [#2390](https://redirect.github.com/tiangolo/fastapi/pull/2390) by [@hard-coders](https://redirect.github.com/hard-coders). - π Add French translation for FastAPI People. PR [#2232](https://redirect.github.com/tiangolo/fastapi/pull/2232) by [@JulianMaurin](https://redirect.github.com/JulianMaurin). - π Add Korean translation for Tutorial - Path Parameters. PR [#2355](https://redirect.github.com/tiangolo/fastapi/pull/2355) by [@hard-coders](https://redirect.github.com/hard-coders). - π Add French translation for Features. PR [#2157](https://redirect.github.com/tiangolo/fastapi/pull/2157) by [@Jefidev](https://redirect.github.com/Jefidev). - π₯ Update FastAPI People. PR [#3031](https://redirect.github.com/tiangolo/fastapi/pull/3031) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). - π Add Chinese translation for Tutorial - Debugging. PR [#2737](https://redirect.github.com/tiangolo/fastapi/pull/2737) by [@blt232018](https://redirect.github.com/blt232018). - π Add Chinese translation for Tutorial - Security - OAuth2 with Password (and hashing), Bearer with JWT tokens. PR [#2642](https://redirect.github.com/tiangolo/fastapi/pull/2642) by [@waynerv](https://redirect.github.com/waynerv). - π Add Korean translation for Tutorial - Header Parameters. PR [#2589](https://redirect.github.com/tiangolo/fastapi/pull/2589) by [@mode9](https://redirect.github.com/mode9). - π Add Chinese translation for Tutorial - Metadata and Docs URLs. PR [#2559](https://redirect.github.com/tiangolo/fastapi/pull/2559) by [@blt232018](https://redirect.github.com/blt232018). - π Add Korean translation for Tutorial - First Steps. PR [#2323](https://redirect.github.com/tiangolo/fastapi/pull/2323) by [@hard-coders](https://redirect.github.com/hard-coders). - π Add Chinese translation for Tutorial - CORS (Cross-Origin Resource Sharing). PR [#2540](https://redirect.github.com/tiangolo/fastapi/pull/2540) by [@blt232018](https://redirect.github.com/blt232018). - π Add Chinese translation for Tutorial - Middleware. PR [#2334](https://redirect.github.com/tiangolo/fastapi/pull/2334) by [@lpdswing](https://redirect.github.com/lpdswing). - π Add Korean translation for Tutorial - Intro. PR [#2317](https://redirect.github.com/tiangolo/fastapi/pull/2317) by [@hard-coders](https://redirect.github.com/hard-coders). - π Add Chinese translation for Tutorial - Bigger Applications - Multiple Files. PR [#2453](https://redirect.github.com/tiangolo/fastapi/pull/2453) by [@waynerv](https://redirect.github.com/waynerv). - π Add Chinese translation for Tutorial - Security - Security Intro. PR [#2443](https://redirect.github.com/tiangolo/fastapi/pull/2443) by [@waynerv](https://redirect.github.com/waynerv). - π Add Chinese translation for Tutorial - Header Parameters. PR [#2412](https://redirect.github.com/tiangolo/fastapi/pull/2412) by [@maoyibo](https://redirect.github.com/maoyibo). - π Add Chinese translation for Tutorial - Extra Data Types. PR [#2410](https://redirect.github.com/tiangolo/fastapi/pull/2410) by [@maoyibo](https://redirect.github.com/maoyibo). - π Add Japanese translation for Deployment - Docker. PR [#2312](https://redirect.github.com/tiangolo/fastapi/pull/2312) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Deployment - Versions. PR [#2310](https://redirect.github.com/tiangolo/fastapi/pull/2310) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Chinese translation for Tutorial - Cookie Parameters. PR [#2261](https://redirect.github.com/tiangolo/fastapi/pull/2261) by [@alicrazy1947](https://redirect.github.com/alicrazy1947). - π Add Japanese translation for Tutorial - Static files. PR [#2260](https://redirect.github.com/tiangolo/fastapi/pull/2260) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Tutorial - Testing. PR [#2259](https://redirect.github.com/tiangolo/fastapi/pull/2259) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Tutorial - Debugging. PR [#2256](https://redirect.github.com/tiangolo/fastapi/pull/2256) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Tutorial - Middleware. PR [#2255](https://redirect.github.com/tiangolo/fastapi/pull/2255) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Concurrency and async / await. PR [#2058](https://redirect.github.com/tiangolo/fastapi/pull/2058) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Chinese translation for Tutorial - Security - Simple OAuth2 with Password and Bearer. PR [#2514](https://redirect.github.com/tiangolo/fastapi/pull/2514) by [@waynerv](https://redirect.github.com/waynerv). - π Add Japanese translation for Deployment - Deta. PR [#2314](https://redirect.github.com/tiangolo/fastapi/pull/2314) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Chinese translation for Tutorial - Security - Get Current User. PR [#2474](https://redirect.github.com/tiangolo/fastapi/pull/2474) by [@waynerv](https://redirect.github.com/waynerv). - π Add Japanese translation for Deployment - Manually. PR [#2313](https://redirect.github.com/tiangolo/fastapi/pull/2313) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Deployment - Intro. PR [#2309](https://redirect.github.com/tiangolo/fastapi/pull/2309) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for FastAPI People. PR [#2254](https://redirect.github.com/tiangolo/fastapi/pull/2254) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Advanced - Path Operation Advanced Configuration. PR [#2124](https://redirect.github.com/tiangolo/fastapi/pull/2124) by [@Attsun1031](https://redirect.github.com/Attsun1031). - π Add Japanese translation for External Links. PR [#2070](https://redirect.github.com/tiangolo/fastapi/pull/2070) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Tutorial - Body - Updates. PR [#1956](https://redirect.github.com/tiangolo/fastapi/pull/1956) by [@SwftAlpc](https://redirect.github.com/SwftAlpc). - π Add Japanese translation for Tutorial - Form Data. PR [#1943](https://redirect.github.com/tiangolo/fastapi/pull/1943) by [@SwftAlpc](https://redirect.github.com/SwftAlpc). - π Add Japanese translation for Tutorial - Cookie Parameters. PR [#1933](https://redirect.github.com/tiangolo/fastapi/pull/1933) by [@SwftAlpc](https://redirect.github.com/SwftAlpc). ##### Internal - π§ Update top banner, point to newsletter. PR [#3003](https://redirect.github.com/tiangolo/fastapi/pull/3003) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Disable sponsor WeTransfer. PR [#3002](https://redirect.github.com/tiangolo/fastapi/pull/3002) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Update FastAPI People. PR [#2880](https://redirect.github.com/tiangolo/fastapi/pull/2880) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). - π₯ Update FastAPI People. PR [#2739](https://redirect.github.com/tiangolo/fastapi/pull/2739) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). - π§ Add new Gold Sponsor Talk Python π. PR [#2673](https://redirect.github.com/tiangolo/fastapi/pull/2673) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Add new Gold Sponsor vim.so π. PR [#2669](https://redirect.github.com/tiangolo/fastapi/pull/2669) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Add FastAPI user survey banner. PR [#2623](https://redirect.github.com/tiangolo/fastapi/pull/2623) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Add new Bronze Sponsor(s) π₯π. PR [#2622](https://redirect.github.com/tiangolo/fastapi/pull/2622) by [@tiangolo](https://redirect.github.com/tiangolo). - π Update social links: add Discord, fix GitHub. PR [#2621](https://redirect.github.com/tiangolo/fastapi/pull/2621) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Update FastAPI People GitHub Sponsors order. PR [#2620](https://redirect.github.com/tiangolo/fastapi/pull/2620) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Update InvestSuite sponsor data. PR [#2608](https://redirect.github.com/tiangolo/fastapi/pull/2608) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Update FastAPI People. PR [#2590](https://redirect.github.com/tiangolo/fastapi/pull/2590) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). ### [`v0.63.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.63.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.62.0...0.63.0) ##### Features - β¨ Improve type annotations, add support for mypy --strict, internally and for external packages. PR [#2547](https://redirect.github.com/tiangolo/fastapi/pull/2547) by [@tiangolo](https://redirect.github.com/tiangolo). ##### Breaking changes - β¬οΈ Upgrade Uvicorn when installing `fastapi[all]` to the latest version including `uvloop`, the new range is `uvicorn[standard] >=0.12.0,<0.14.0`. PR [#2548](https://redirect.github.com/tiangolo/fastapi/pull/2548) by [@tiangolo](https://redirect.github.com/tiangolo). ##### Fixes - π PR [#2547](https://redirect.github.com/tiangolo/fastapi/pull/2547) (read above) also fixes some false-positive mypy errors with `callbacks` parameters and when using the `OAuth2` class. ##### Docs - π Update Uvicorn installation instructions to use uvicorn\[standard] (includes uvloop). PR [#2543](https://redirect.github.com/tiangolo/fastapi/pull/2543) by [@tiangolo](https://redirect.github.com/tiangolo). - π Update title for Deta tutorial. PR [#2466](https://redirect.github.com/tiangolo/fastapi/pull/2466) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Update FastAPI People. PR [#2454](https://redirect.github.com/tiangolo/fastapi/pull/2454) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). ##### Translations - π Add docs lang selector widget. PR [#2542](https://redirect.github.com/tiangolo/fastapi/pull/2542) by [@tiangolo](https://redirect.github.com/tiangolo). - π Add Chinese translation for Tutorial - Response Status Code. PR [#2442](https://redirect.github.com/tiangolo/fastapi/pull/2442) by [@waynerv](https://redirect.github.com/waynerv). - π Start translation of the documentation for the Albanian language. PR [#2516](https://redirect.github.com/tiangolo/fastapi/pull/2516) by [@vjanz](https://redirect.github.com/vjanz). - π Add Chinese translation for Tutorial - Extra Models. PR [#2416](https://redirect.github.com/tiangolo/fastapi/pull/2416) by [@waynerv](https://redirect.github.com/waynerv). - π Add Chinese translation for Tutorial - Response Model. PR [#2414](https://redirect.github.com/tiangolo/fastapi/pull/2414) by [@waynerv](https://redirect.github.com/waynerv). - π Add Chinese translation for Tutorial - Schema Extra Example. PR [#2411](https://redirect.github.com/tiangolo/fastapi/pull/2411) by [@maoyibo](https://redirect.github.com/maoyibo). - π Add Korean translation for Index. PR [#2192](https://redirect.github.com/tiangolo/fastapi/pull/2192) by [@hard-coders](https://redirect.github.com/hard-coders). - π Add Japanese translation for Advanced User Guide - Additional Status Codes. PR [#2145](https://redirect.github.com/tiangolo/fastapi/pull/2145) by [@Attsun1031](https://redirect.github.com/Attsun1031). ##### Internal - π Fix docs overrides directory for translations. PR [#2541](https://redirect.github.com/tiangolo/fastapi/pull/2541) by [@tiangolo](https://redirect.github.com/tiangolo). - β Remove Typer as a docs building dependency (covered by typer-cli) to fix pip resolver conflicts. PR [#2539](https://redirect.github.com/tiangolo/fastapi/pull/2539) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Add newsletter: FastAPI and friends. PR [#2509](https://redirect.github.com/tiangolo/fastapi/pull/2509) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Add new Gold Sponsor: InvestSuite π. PR [#2508](https://redirect.github.com/tiangolo/fastapi/pull/2508) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Add issue template configs. PR [#2476](https://redirect.github.com/tiangolo/fastapi/pull/2476) by [@tiangolo](https://redirect.github.com/tiangolo). ### [`v0.62.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.62.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.61.2...0.62.0) ##### Features - β¨ Add support for shared/top-level parameters (dependencies, tags, etc). PR [#2434](https://redirect.github.com/tiangolo/fastapi/pull/2434) by [@tiangolo](https://redirect.github.com/tiangolo). Up to now, for several options, the only way to apply them to a group of *path operations* was in `include_router`. That works well, but the call to `app.include_router()` or `router.include_router()` is normally done in another file. That means that, for example, to apply authentication to all the *path operations* in a router it would end up being done in a different file, instead of keeping related logic together. Setting options in `include_router` still makes sense in some cases, for example, to override or increase configurations from a third party router included in an app. But in a router that is part of a bigger application, it would probably make more sense to add those settings when creating the `APIRouter`. **In `FastAPI`** This allows setting the (mostly new) parameters (additionally to the already existing parameters): - `default_response_class`: updated to handle defaults in `APIRouter` and `include_router`. - `dependencies`: to include β¨ top-level dependencies β¨ that apply to the whole application. E.g. to add global authentication. - `callbacks`: OpenAPI callbacks that apply to all the *path operations*. - `deprecated`: to mark all the *path operations* as deprecated. π€· - `include_in_schema`: to allow excluding all the *path operations* from the OpenAPI schema. - `responses`: OpenAPI responses that apply to all the *path operations*. For example: ```Python from fastapi import FastAPI, Depends async def some_dependency(): return app = FastAPI(dependencies=[Depends(some_dependency)]) ``` **In `APIRouter`** This allows setting the (mostly new) parameters (additionally to the already existing parameters): - `default_response_class`: updated to handle defaults in `APIRouter` and `include_router`. For example, it's not needed to set it explicitly when [creating callbacks](https://fastapi.tiangolo.com/advanced/openapi-callbacks/). - `dependencies`: to include β¨ router-level dependencies β¨ that apply to all the *path operations* in a router. Up to now, this was only possible with `include_router`. - `callbacks`: OpenAPI callbacks that apply to all the *path operations* in this router. - `deprecated`: to mark all the *path operations* in a router as deprecated. - `include_in_schema`: to allow excluding all the *path operations* in a router from the OpenAPI schema. - `responses`: OpenAPI responses that apply to all the *path operations* in a router. - `prefix`: to set the path prefix for a router. Up to now, this was only possible when calling `include_router`. - `tags`: OpenAPI tags to apply to all the *path operations* in this router. For example: ```Python from fastapi import APIRouter, Depends async def some_dependency(): return router = APIRouter(prefix="/users", dependencies=[Depends(some_dependency)]) ``` **In `include_router`** Most of these settings are now supported in `APIRouter`, which normally lives closer to the related code, so it is recommended to use `APIRouter` when possible. But `include_router` is still useful to, for example, adding options (like `dependencies`, `prefix`, and `tags`) when including a third party router, or a generic router that is shared between several projects. This PR allows setting the (mostly new) parameters (additionally to the already existing parameters): - `default_response_class`: updated to handle defaults in `APIRouter` and `FastAPI`. - `deprecated`: to mark all the *path operations* in a router as deprecated in OpenAPI. - `include_in_schema`: to allow disabling all the *path operations* from showing in the OpenAPI schema. - `callbacks`: OpenAPI callbacks that apply to all the *path operations* in this router. Note: all the previous parameters are still there, so it's still possible to declare `dependencies` in `include_router`. ##### Breaking Changes - PR [#2434](https://redirect.github.com/tiangolo/fastapi/pull/2434) includes several improvements that shouldn't affect normal use cases, but could affect in advanced scenarios: - If you are testing the generated OpenAPI (you shouldn't, FastAPI already tests it extensively for you): the order for `tags` in `include_router` and *path operations* was updated for consistency, but it's a simple order change. - If you have advanced custom logic to access each route's `route.response_class`, or the `router.default_response_class`, or the `app.default_response_class`: the default value for `response_class` in `APIRoute` and for `default_response_class` in `APIRouter` and `FastAPI` is now a `DefaultPlaceholder` used internally to handle and solve default values and overrides. The actual response class inside the `DefaultPlaceholder` is available at `route.response_class.value`. ##### Docs - PR [#2434](https://redirect.github.com/tiangolo/fastapi/pull/2434) (above) includes new or updated docs: - Advanced User Guide - OpenAPI Callbacks. - Tutorial - Bigger Applications. - Tutorial - Dependencies - Dependencies in path operation decorators. - Tutorial - Dependencies - Global Dependencies. - π Add FastAPI monitoring blog post to External Links. PR [#2324](https://redirect.github.com/tiangolo/fastapi/pull/2324) by [@louisguitton](https://redirect.github.com/louisguitton). - βοΈ Fix typo in Deta tutorial. PR [#2320](https://redirect.github.com/tiangolo/fastapi/pull/2320) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Add Discord chat. PR [#2322](https://redirect.github.com/tiangolo/fastapi/pull/2322) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix image links for sponsors. PR [#2304](https://redirect.github.com/tiangolo/fastapi/pull/2304) by [@tiangolo](https://redirect.github.com/tiangolo). ##### Translations - π Add Japanese translation for Advanced - Custom Response. PR [#2193](https://redirect.github.com/tiangolo/fastapi/pull/2193) by [@Attsun1031](https://redirect.github.com/Attsun1031). - π Add Chinese translation for Benchmarks. PR [#2119](https://redirect.github.com/tiangolo/fastapi/pull/2119) by [@spaceack](https://redirect.github.com/spaceack). - π Add Chinese translation for Tutorial - Body - Nested Models. PR [#1609](https://redirect.github.com/tiangolo/fastapi/pull/1609) by [@waynerv](https://redirect.github.com/waynerv). - π Add Chinese translation for Advanced - Custom Response. PR [#1459](https://redirect.github.com/tiangolo/fastapi/pull/1459) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu). - π Add Chinese translation for Advanced - Return a Response Directly. PR [#1452](https://redirect.github.com/tiangolo/fastapi/pull/1452) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu). - π Add Chinese translation for Advanced - Additional Status Codes. PR [#1451](https://redirect.github.com/tiangolo/fastapi/pull/1451) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu). - π Add Chinese translation for Advanced - Path Operation Advanced Configuration. PR [#1447](https://redirect.github.com/tiangolo/fastapi/pull/1447) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu). - π Add Chinese translation for Advanced User Guide - Intro. PR [#1445](https://redirect.github.com/tiangolo/fastapi/pull/1445) by [@RunningIkkyu](https://redirect.github.com/RunningIkkyu). ##### Internal - π§ Update TestDriven link to course in sponsors section. PR [#2435](https://redirect.github.com/tiangolo/fastapi/pull/2435) by [@tiangolo](https://redirect.github.com/tiangolo). - π± Update sponsor logos. PR [#2418](https://redirect.github.com/tiangolo/fastapi/pull/2418) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix disabling install of Material for MkDocs Insiders in forks, strike 1 βΎ. PR [#2340](https://redirect.github.com/tiangolo/fastapi/pull/2340) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix disabling Material for MkDocs Insiders install in forks. PR [#2339](https://redirect.github.com/tiangolo/fastapi/pull/2339) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Add silver sponsor WeTransfer. PR [#2338](https://redirect.github.com/tiangolo/fastapi/pull/2338) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Set up and enable Material for MkDocs Insiders for the docs. PR [#2325](https://redirect.github.com/tiangolo/fastapi/pull/2325) by [@tiangolo](https://redirect.github.com/tiangolo). ### [`v0.61.2`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.61.2) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.61.1...0.61.2) ##### Fixes - π Relax Swagger UI version pin. PR [#2089](https://redirect.github.com/tiangolo/fastapi/pull/2089) by [@jmriebold](https://redirect.github.com/jmriebold). - π Fix bug overriding custom HTTPException and RequestValidationError from exception_handlers. PR [#1924](https://redirect.github.com/tiangolo/fastapi/pull/1924) by [@uriyyo](https://redirect.github.com/uriyyo). - βοΈ Fix typo on dependencies utils and cleanup unused variable. PR [#1912](https://redirect.github.com/tiangolo/fastapi/pull/1912) by [@Kludex](https://redirect.github.com/Kludex). ##### Docs - βοΈ Fix typo in Tutorial - Path Parameters. PR [#2231](https://redirect.github.com/tiangolo/fastapi/pull/2231) by [@mariacamilagl](https://redirect.github.com/mariacamilagl). - β Fix a stylistic error in docs. PR [#2206](https://redirect.github.com/tiangolo/fastapi/pull/2206) by [@ddobrinskiy](https://redirect.github.com/ddobrinskiy). - β Fix capitalizaiton typo in docs. PR [#2204](https://redirect.github.com/tiangolo/fastapi/pull/2204) by [@imba-tjd](https://redirect.github.com/imba-tjd). - β Fix typo in docs. PR [#2179](https://redirect.github.com/tiangolo/fastapi/pull/2179) by [@ammarasmro](https://redirect.github.com/ammarasmro). - π Update/fix links in docs to use HTTPS. PR [#2165](https://redirect.github.com/tiangolo/fastapi/pull/2165) by [@imba-tjd](https://redirect.github.com/imba-tjd). - β Fix typos and add rewording in docs. PR [#2159](https://redirect.github.com/tiangolo/fastapi/pull/2159) by [@nukopy](https://redirect.github.com/nukopy). - π Fix code consistency in examples for Tutorial - User Guide - Path Parameters. PR [#2158](https://redirect.github.com/tiangolo/fastapi/pull/2158) by [@nukopy](https://redirect.github.com/nukopy). - π Fix renamed parameter `content_type` typo. PR [#2135](https://redirect.github.com/tiangolo/fastapi/pull/2135) by [@TeoZosa](https://redirect.github.com/TeoZosa). - β Fix minor typos in docs. PR [#2122](https://redirect.github.com/tiangolo/fastapi/pull/2122) by [@TeoZosa](https://redirect.github.com/TeoZosa). - β Fix typos in docs and source examples. PR [#2102](https://redirect.github.com/tiangolo/fastapi/pull/2102) by [@AdrianDeAnda](https://redirect.github.com/AdrianDeAnda). - β Fix incorrect Celery URLs in docs. PR [#2100](https://redirect.github.com/tiangolo/fastapi/pull/2100) by [@CircleOnCircles](https://redirect.github.com/CircleOnCircles). - π Simplify intro to Python Types, all currently supported Python versions include type hints π. PR [#2085](https://redirect.github.com/tiangolo/fastapi/pull/2085) by [@ninjaaron](https://redirect.github.com/ninjaaron). - π Fix example code with sets in Tutorial - Body - Nested Models 3. PR [#2054](https://redirect.github.com/tiangolo/fastapi/pull/2054) by [@hitrust](https://redirect.github.com/hitrust). - π Fix example code with sets in Tutorial - Body - Nested Models 2. PR [#2053](https://redirect.github.com/tiangolo/fastapi/pull/2053) by [@hitrust](https://redirect.github.com/hitrust). - π Fix example code with sets in Tutorial - Body - Nested Models. PR [#2052](https://redirect.github.com/tiangolo/fastapi/pull/2052) by [@hitrust](https://redirect.github.com/hitrust). - β Fix typo in Benchmarks. PR [#1995](https://redirect.github.com/tiangolo/fastapi/pull/1995) by [@AlejoAsd](https://redirect.github.com/AlejoAsd). - π Add note in CORS tutorial about allow_origins with \["\*"] and allow_credentials. PR [#1895](https://redirect.github.com/tiangolo/fastapi/pull/1895) by [@dsmurrell](https://redirect.github.com/dsmurrell). - π Add deployment to Deta, the first gold sponsor π. PR [#2303](https://redirect.github.com/tiangolo/fastapi/pull/2303) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Update FastAPI People. PR [#2282](https://redirect.github.com/tiangolo/fastapi/pull/2282) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). - βοΈ Fix uppercase in Tutorial - Query parameters. PR [#2245](https://redirect.github.com/tiangolo/fastapi/pull/2245) by [@mariacamilagl](https://redirect.github.com/mariacamilagl). - π Add articles to External Links. PR [#2247](https://redirect.github.com/tiangolo/fastapi/pull/2247) by [@tiangolo](https://redirect.github.com/tiangolo). - β Fix typo in Spanish tutorial index. PR [#2020](https://redirect.github.com/tiangolo/fastapi/pull/2020) by [@aviloncho](https://redirect.github.com/aviloncho). ##### Translations - π Add Japanese translation for Advanced Tutorial - Response Directly. PR [#2191](https://redirect.github.com/tiangolo/fastapi/pull/2191) by [@Attsun1031](https://redirect.github.com/Attsun1031). - π Add Japanese translation for Tutorial - Security - First Steps. PR [#2153](https://redirect.github.com/tiangolo/fastapi/pull/2153) by [@komtaki](https://redirect.github.com/komtaki). - π Add Japanese translation for Tutorial - Query Parameters and String Validations. PR [#1901](https://redirect.github.com/tiangolo/fastapi/pull/1901) by [@SwftAlpc](https://redirect.github.com/SwftAlpc). - π Add Portuguese translation for External Links. PR [#1443](https://redirect.github.com/tiangolo/fastapi/pull/1443) by [@Serrones](https://redirect.github.com/Serrones). - π Add Japanese translation for Tutorial - CORS. PR [#2125](https://redirect.github.com/tiangolo/fastapi/pull/2125) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Contributing. PR [#2067](https://redirect.github.com/tiangolo/fastapi/pull/2067) by [@komtaki](https://redirect.github.com/komtaki). - π Add Japanese translation for Project Generation. PR [#2050](https://redirect.github.com/tiangolo/fastapi/pull/2050) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Alternatives. PR [#2043](https://redirect.github.com/tiangolo/fastapi/pull/2043) by [@Attsun1031](https://redirect.github.com/Attsun1031). - π Add Japanese translation for History Design and Future. PR [#2002](https://redirect.github.com/tiangolo/fastapi/pull/2002) by [@komtaki](https://redirect.github.com/komtaki). - π Add Japanese translation for Benchmarks. PR [#1992](https://redirect.github.com/tiangolo/fastapi/pull/1992) by [@komtaki](https://redirect.github.com/komtaki). - π Add Japanese translation for Tutorial - Header Parameters. PR [#1935](https://redirect.github.com/tiangolo/fastapi/pull/1935) by [@SwftAlpc](https://redirect.github.com/SwftAlpc). - π Add Portuguese translation for Tutorial - First Steps. PR [#1861](https://redirect.github.com/tiangolo/fastapi/pull/1861) by [@jessicapaz](https://redirect.github.com/jessicapaz). - π Add Portuguese translation for Python Types. PR [#1796](https://redirect.github.com/tiangolo/fastapi/pull/1796) by [@izaguerreiro](https://redirect.github.com/izaguerreiro). - π Add Japanese translation for Help FastAPI. PR [#1692](https://redirect.github.com/tiangolo/fastapi/pull/1692) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Tutorial - Body. PR [#1683](https://redirect.github.com/tiangolo/fastapi/pull/1683) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for Tutorial - Query Params. PR [#1674](https://redirect.github.com/tiangolo/fastapi/pull/1674) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for tutorial/path-params.md. PR [#1671](https://redirect.github.com/tiangolo/fastapi/pull/1671) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for tutorial/first-steps.md. PR [#1658](https://redirect.github.com/tiangolo/fastapi/pull/1658) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add Japanese translation for tutorial/index.md. PR [#1656](https://redirect.github.com/tiangolo/fastapi/pull/1656) by [@tokusumi](https://redirect.github.com/tokusumi). - π Add translation to Portuguese for Project Generation. PR [#1602](https://redirect.github.com/tiangolo/fastapi/pull/1602) by [@Serrones](https://redirect.github.com/Serrones). - π Add Japanese translation for Features. PR [#1625](https://redirect.github.com/tiangolo/fastapi/pull/1625) by [@tokusumi](https://redirect.github.com/tokusumi). - π Initialize new language Korean for translations. PR [#2018](https://redirect.github.com/tiangolo/fastapi/pull/2018) by [@hard-coders](https://redirect.github.com/hard-coders). - π Add Portuguese translation of Deployment. PR [#1374](https://redirect.github.com/tiangolo/fastapi/pull/1374) by [@Serrones](https://redirect.github.com/Serrones). ##### Internal - π₯ Cleanup after upgrade for Docs Previews GitHub Action. PR [#2248](https://redirect.github.com/tiangolo/fastapi/pull/2248) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix CI docs preview, unzip docs. PR [#2246](https://redirect.github.com/tiangolo/fastapi/pull/2246) by [@tiangolo](https://redirect.github.com/tiangolo). - β¨ Add instant docs deploy previews for PRs from forks. PR [#2244](https://redirect.github.com/tiangolo/fastapi/pull/2244) by [@tiangolo](https://redirect.github.com/tiangolo). - β‘οΈ Build docs for languages in parallel in subprocesses to speed up CI. PR [#2242](https://redirect.github.com/tiangolo/fastapi/pull/2242) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix docs order generation for partial translations. PR [#2238](https://redirect.github.com/tiangolo/fastapi/pull/2238) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Update FastAPI People. PR [#2202](https://redirect.github.com/tiangolo/fastapi/pull/2202) by [@github-actions\[bot\]](https://redirect.github.com/apps/github-actions). - β»οΈ Update FastAPI People GitHub Action to send the PR as github-actions. PR [#2201](https://redirect.github.com/tiangolo/fastapi/pull/2201) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Update FastAPI People GitHub Action config, run monthly. PR [#2199](https://redirect.github.com/tiangolo/fastapi/pull/2199) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix FastAPI People GitHub Action Docker dependency, strike 1 βΎ. PR [#2198](https://redirect.github.com/tiangolo/fastapi/pull/2198) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix FastAPI People GitHub Action Docker dependencies. PR [#2197](https://redirect.github.com/tiangolo/fastapi/pull/2197) by [@tiangolo](https://redirect.github.com/tiangolo). - π Fix FastAPI People GitHub Action when there's nothing to change. PR [#2196](https://redirect.github.com/tiangolo/fastapi/pull/2196) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Add new section FastAPI People. PR [#2195](https://redirect.github.com/tiangolo/fastapi/pull/2195) by [@tiangolo](https://redirect.github.com/tiangolo). - β¬οΈ Upgrade GitHub Action Latest Changes. PR [#2190](https://redirect.github.com/tiangolo/fastapi/pull/2190) by [@tiangolo](https://redirect.github.com/tiangolo). - β¬οΈ Upgrade GitHub Action Label Approved. PR [#2189](https://redirect.github.com/tiangolo/fastapi/pull/2189) by [@tiangolo](https://redirect.github.com/tiangolo). - π§ Update GitHub Action Label Approved, run at 12:00. PR [#2185](https://redirect.github.com/tiangolo/fastapi/pull/2185) by [@tiangolo](https://redirect.github.com/tiangolo). - π· Upgrade GitHub Action Latest Changes. PR [#2184](https://redirect.github.com/tiangolo/fastapi/pull/2184) by [@tiangolo](https://redirect.github.com/tiangolo). - π· Set GitHub Action Label Approved to run daily, not every minute. PR [#2163](https://redirect.github.com/tiangolo/fastapi/pull/2163) by [@tiangolo](https://redirect.github.com/tiangolo). - π₯ Remove pr-approvals GitHub Action as it's not compatible with forks. Use the new one. PR [#2162](https://redirect.github.com/tiangolo/fastapi/pull/2162) by [@tiangolo](https://redirect.github.com/tiangolo). - π· Add GitHub Action Latest Changes. PR [#2160](https://redirect.github.com/tiangolo/fastapi/pull/2160). - π· Add GitHub Action Label Approved. PR [#2161](https://redirect.github.com/tiangolo/fastapi/pull/2161). ### [`v0.61.1`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.61.1) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.61.0...0.61.1) ##### Fixes - Fix issues using `jsonable_encoder` with SQLAlchemy models directly. PR [#1987](https://redirect.github.com/tiangolo/fastapi/pull/1987). ##### Docs - Fix typo in NoSQL docs. PR [#1980](https://redirect.github.com/tiangolo/fastapi/pull/1980) by [@facundojmaero](https://redirect.github.com/facundojmaero). ##### Translations - Add translation for [main page to Japanese](https://fastapi.tiangolo.com/ja/) PR [#1571](https://redirect.github.com/tiangolo/fastapi/pull/1571) by [@ryuckel](https://redirect.github.com/ryuckel). - Initialize French translations. PR [#1975](https://redirect.github.com/tiangolo/fastapi/pull/1975) by [@JulianMaurin-BM](https://redirect.github.com/JulianMaurin-BM). - Initialize Turkish translations. PR [#1905](https://redirect.github.com/tiangolo/fastapi/pull/1905) by [@ycd](https://redirect.github.com/ycd). ##### Internal - Improve docs maintainability by updating `hl_lines` syntax to use ranges. PR [#1863](https://redirect.github.com/tiangolo/fastapi/pull/1863) by [@la-mar](https://redirect.github.com/la-mar). ### [`v0.61.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.61.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.60.2...0.61.0) ##### Features - Add support for injecting `HTTPConnection` (as `Request` and `WebSocket`). Useful for sharing app state in dependencies. PR [#1827](https://redirect.github.com/tiangolo/fastapi/pull/1827) by [@nsidnev](https://redirect.github.com/nsidnev). - Export `WebSocketDisconnect` and add example handling WebSocket disconnections to docs. PR [#1822](https://redirect.github.com/tiangolo/fastapi/pull/1822) by [@rkbeatss](https://redirect.github.com/rkbeatss). ##### Breaking Changes - Require Pydantic > `1.0.0`. - Remove support for deprecated Pydantic `0.32.2`. This improves maintainability and allows new features. - In `FastAPI` and `APIRouter`: - Remove *path operation decorators* related/deprecated parameter `response_model_skip_defaults` (use `response_model_exclude_unset` instead). - Change *path operation decorators* parameter default for `response_model_exclude` from `set()` to `None` (as is in Pydantic). - In `encoders.jsonable_encoder`: - Remove deprecated `skip_defaults`, use instead `exclude_unset`. - Set default of `exclude` from `set()` to `None` (as is in Pydantic). - PR [#1862](https://redirect.github.com/tiangolo/fastapi/pull/1862). - In `encoders.jsonable_encoder` remove parameter `sqlalchemy_safe`. - It was an early hack to allow returning SQLAlchemy models, but it was never documented, and the recommended way is using Pydantic's `orm_mode` as described in the tutorial: [SQL (Relational) Databases](https://fastapi.tiangolo.com/tutorial/sql-databases/). - PR [#1864](https://redirect.github.com/tiangolo/fastapi/pull/1864). ##### Docs - Add link to the course by TestDriven.io: [Test-Driven Development with FastAPI and Docker](https://testdriven.io/courses/tdd-fastapi/). PR [#1860](https://redirect.github.com/tiangolo/fastapi/pull/1860). - Fix empty log message in docs example about handling errors. PR [#1815](https://redirect.github.com/tiangolo/fastapi/pull/1815) by [@manlix](https://redirect.github.com/manlix). - Reword text to reduce ambiguity while not being gender-specific. PR [#1824](https://redirect.github.com/tiangolo/fastapi/pull/1824) by [@Mause](https://redirect.github.com/Mause). ##### Internal - Add Flake8 linting. Original PR [#1774](https://redirect.github.com/tiangolo/fastapi/pull/1774) by [@MashhadiNima](https://redirect.github.com/MashhadiNima). - Disable Gitter bot, as it's currently broken, and Gitter's response doesn't show the problem. PR [#1853](https://redirect.github.com/tiangolo/fastapi/pull/1853). ### [`v0.60.2`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.60.2) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.60.1...0.60.2) - Fix typo in docs for query parameters. PR [#1832](https://redirect.github.com/tiangolo/fastapi/pull/1832) by [@ycd](https://redirect.github.com/ycd). - Add docs about [Async Tests](https://fastapi.tiangolo.com/advanced/async-tests/). PR [#1619](https://redirect.github.com/tiangolo/fastapi/pull/1619) by [@empicano](https://redirect.github.com/empicano). - Raise an exception when using form data (`Form`, `File`) without having `python-multipart` installed. - Up to now the application would run, and raise an exception only when receiving a request with form data, the new behavior, raising early, will prevent from deploying applications with broken dependencies. - It also detects if the correct package `python-multipart` is installed instead of the incorrect `multipart` (both importable as `multipart`). - PR [#1851](https://redirect.github.com/tiangolo/fastapi/pull/1851) based on original PR [#1627](https://redirect.github.com/tiangolo/fastapi/pull/1627) by [@chrisngyn](https://redirect.github.com/chrisngyn), [@YKo20010](https://redirect.github.com/YKo20010), [@kx-chen](https://redirect.github.com/kx-chen). - Re-enable Gitter releases bot. PR [#1831](https://redirect.github.com/tiangolo/fastapi/pull/1831). - Add link to async SQL databases tutorial from main SQL tutorial. PR [#1813](https://redirect.github.com/tiangolo/fastapi/pull/1813) by [@short2strings](https://redirect.github.com/short2strings). - Fix typo in tutorial about behind a proxy. PR [#1807](https://redirect.github.com/tiangolo/fastapi/pull/1807) by [@toidi](https://redirect.github.com/toidi). - Fix typo in Portuguese docs. PR [#1795](https://redirect.github.com/tiangolo/fastapi/pull/1795) by [@izaguerreiro](https://redirect.github.com/izaguerreiro). - Add translations setup for Ukrainian. PR [#1830](https://redirect.github.com/tiangolo/fastapi/pull/1830). - Add external link [Build And Host Fast Data Science Applications Using FastAPI](https://towardsdatascience.com/build-and-host-fast-data-science-applications-using-fastapi-823be8a1d6a0). PR [#1786](https://redirect.github.com/tiangolo/fastapi/pull/1786) by [@Kludex](https://redirect.github.com/Kludex). - Fix encoding of Pydantic models that inherit from others models with custom `json_encoders`. PR [#1769](https://redirect.github.com/tiangolo/fastapi/pull/1769) by [@henrybetts](https://redirect.github.com/henrybetts). - Simplify and improve `jsonable_encoder`. PR [#1754](https://redirect.github.com/tiangolo/fastapi/pull/1754) by [@MashhadiNima](https://redirect.github.com/MashhadiNima). - Simplify internal code syntax in several points. PR [#1753](https://redirect.github.com/tiangolo/fastapi/pull/1753) by [@uriyyo](https://redirect.github.com/uriyyo). - Improve internal typing, declare `Optional` parameters. PR [#1731](https://redirect.github.com/tiangolo/fastapi/pull/1731) by [@MashhadiNima](https://redirect.github.com/MashhadiNima). - Add external link [Deploy FastAPI on Azure App Service](https://www.tutlinks.com/deploy-fastapi-on-azure/) to docs. PR [#1726](https://redirect.github.com/tiangolo/fastapi/pull/1726) by [@windson](https://redirect.github.com/windson). - Add link to Starlette docs about WebSocket testing. PR [#1717](https://redirect.github.com/tiangolo/fastapi/pull/1717) by [@hellocoldworld](https://redirect.github.com/hellocoldworld). - Refactor generating dependant, merge for loops. PR [#1714](https://redirect.github.com/tiangolo/fastapi/pull/1714) by [@Bloodielie](https://redirect.github.com/Bloodielie). - Update example for templates with Jinja to include HTML media type. PR [#1690](https://redirect.github.com/tiangolo/fastapi/pull/1690) by [@frafra](https://redirect.github.com/frafra). - Fix typos in docs for security. PR [#1678](https://redirect.github.com/tiangolo/fastapi/pull/1678) by [@nilslindemann](https://redirect.github.com/nilslindemann). - Fix typos in docs for dependencies. PR [#1675](https://redirect.github.com/tiangolo/fastapi/pull/1675) by [@nilslindemann](https://redirect.github.com/nilslindemann). - Fix type annotation for `**extra` parameters in `FastAPI`. PR [#1659](https://redirect.github.com/tiangolo/fastapi/pull/1659) by [@bharel](https://redirect.github.com/bharel). - Bump MkDocs Material to fix docs in browsers with dark mode. PR [#1789](https://redirect.github.com/tiangolo/fastapi/pull/1789) by [@adriencaccia](https://redirect.github.com/adriencaccia). - Remove docs preview comment from each commit. PR [#1826](https://redirect.github.com/tiangolo/fastapi/pull/1826). - Update GitHub context extraction for Gitter notification bot. PR [#1766](https://redirect.github.com/tiangolo/fastapi/pull/1766). ### [`v0.60.1`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.60.1) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.60.0...0.60.1) - Add debugging logs for GitHub actions to introspect GitHub hidden context. PR [#1764](https://redirect.github.com/tiangolo/fastapi/pull/1764). - Use OS preference theme for online docs. PR [#1760](https://redirect.github.com/tiangolo/fastapi/pull/1760) by [@adriencaccia](https://redirect.github.com/adriencaccia). - Upgrade Starlette to version `0.13.6` to handle a vulnerability when using static files in Windows. PR [#1759](https://redirect.github.com/tiangolo/fastapi/pull/1759) by [@jamesag26](https://redirect.github.com/jamesag26). - Pin Swagger UI temporarily, waiting for a fix for [swagger-api/swagger-ui#6249](https://redirect.github.com/swagger-api/swagger-ui/issues/6249). PR [#1763](https://redirect.github.com/tiangolo/fastapi/pull/1763). - Update GitHub Actions, use commit from PR for docs preview, not commit from pre-merge. PR [#1761](https://redirect.github.com/tiangolo/fastapi/pull/1761). - Update GitHub Actions, refactor Gitter bot. PR [#1746](https://redirect.github.com/tiangolo/fastapi/pull/1746). ### [`v0.60.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.60.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.59.0...0.60.0) - Add GitHub Action to watch for missing preview docs and trigger a preview deploy. PR [#1740](https://redirect.github.com/tiangolo/fastapi/pull/1740). - Add custom GitHub Action to get artifact with docs preview. PR [#1739](https://redirect.github.com/tiangolo/fastapi/pull/1739). - Add new GitHub Actions to preview docs from PRs. PR [#1738](https://redirect.github.com/tiangolo/fastapi/pull/1738). - Add XML test coverage to support GitHub Actions. PR [#1737](https://redirect.github.com/tiangolo/fastapi/pull/1737). - Update badges and remove Travis now that GitHub Actions is the main CI. PR [#1736](https://redirect.github.com/tiangolo/fastapi/pull/1736). - Add GitHub Actions for CI, move from Travis. PR [#1735](https://redirect.github.com/tiangolo/fastapi/pull/1735). - Add support for adding OpenAPI schema for GET requests with a body. PR [#1626](https://redirect.github.com/tiangolo/fastapi/pull/1626) by [@victorphoenix3](https://redirect.github.com/victorphoenix3). ### [`v0.59.0`](https://redirect.github.com/fastapi/fastapi/releases/tag/0.59.0) [Compare Source](https://redirect.github.com/fastapi/fastapi/compare/0.58.1...0.59.0) - Fix typo in docstring for OAuth2 utils. PR [#1621](https://redirect.github.com/tiangolo/fastapi/pull/1621) by [@tomarv2](https://redirect.github.com/tomarv2). - Update JWT docs to use Python-jose instead of PyJWT. Initial PR [#1610](https://redirect.github.com/tiangolo/fastapi/pull/1610) by [@asheux](https://redirect.github.com/asheux). - Fix/re-enable search bar in docs. PR [#1703](https://redirect.github.com/tiangolo/fastapi/pull/1703). - Auto-generate a "server" in OpenAPI `servers` when there's a `root_path` instead of prefixing all the `paths`: - Add a new parameter for `FastAPI` classes: `root_path_in_servers` to disable the auto-generation of `servers`. - New docs about `root_path` and `servers` in [Additional Servers](https://fastapi.tiangolo.com/advanced/behind-a-proxy/#additional-servers). - Update OAuth2 examples to use a relative URL for `tokenUrl="token"` to make sure those examples keep working as-is even when behind a reverse proxy. - Initial PR [#1596](https://redirect.github.com/tiangolo/fastapi/pull/1596) by [@rkbeatss](https://redirect.github.com/rkbeatss). - Fix typo/link in External Links. PR [#1702](https://redirect.github.com/tiangolo/fastapi/pull/1702). - Update handling of [External Links](https://fastapi.tiangolo.com/external-links/) to use a data file and allow translating the headers without becoming obsolete quickly when new links are added. PR [#https://github.com/tiangolo/fastapi/pull/1701](https://redirect.github.com/tiangolo/fastapi/pull/1701). - Add external link [Machine learning model serving in Python using FastAPI and Streamlit](https://davidefiocco.github.io/2020/06/27/streamlit-fastapi-ml-serving.html) to docs. PR [#1669](https://redirect.github.com/tiangolo/fastapi/pull/1669) by [@davidefiocco](https://redirect.github.com/davidefiocco). - Add note in docs on order in Pydantic Unions. PR [#1591](https://redirect.github.com/tiangolo/fastapi/pull/1591) by [@kbanc](https://redirect.github.com/kbanc). - Improve support for tests in editor. PR [#1699](https://redirect.github.com/tiangolo/fastapi/pull/1699). - Pin dependencies. PR [#1697](https://redirect.github.com/tiangolo/fastapi/pull/1697). - Update isort to version 5.x.x. PR [#1670](https://redirect.github.com/tiangolo/fastapi/pull/1670) by [@asheu