All Versions
12
Latest Version
Avg Release Cycle
15 days
Latest Release
1469 days ago

Changelog History
Page 1

  • v0.62.0 Changes

    November 29, 2020

    ๐Ÿ”‹ Features

    • ๐Ÿฑ โœจ Add support for shared/top-level parameters (dependencies, tags, etc). PR #2434 by @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:

    from fastapi import FastAPI, Dependsasync def some\_dependency(): returnapp = 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.
    • 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:

    from fastapi import APIRouter, Dependsasync def some\_dependency(): returnrouter = 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 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 (above) includes new or updated docs:

    - Tutorial - Dependencies - Global Dependencies.

    ๐Ÿฑ ๐Ÿ“ Add FastAPI monitoring blog post to External Links. PR #2324 by @louisguitton.

    ๐Ÿฑ โœ๏ธ Fix typo in Deta tutorial. PR #2320 by @tiangolo.

    ๐Ÿฑ โœจ Add Discord chat. PR #2322 by @tiangolo.

    ๐Ÿฑ ๐Ÿ“ Fix image links for sponsors. PR #2304 by @tiangolo.

    ๐ŸŒ Translations

    • ๐ŸŒ Add Japanese translation for Advanced - Custom Response. PR #2193 by @Attsun1031.
    • ๐ŸŒ Add Chinese translation for Benchmarks. PR #2119 by @spaceack.
    • ๐ŸŒ Add Chinese translation for Tutorial - Body - Nested Models. PR #1609 by @waynerv.
    • ๐ŸŒ Add Chinese translation for Advanced - Custom Response. PR #1459 by @RunningIkkyu.
    • ๐ŸŒ Add Chinese translation for Advanced - Return a Response Directly. PR #1452 by @RunningIkkyu.
    • ๐ŸŒ Add Chinese translation for Advanced - Additional Status Codes. PR #1451 by @RunningIkkyu.
    • ๐ŸŒ Add Chinese translation for Advanced - Path Operation Advanced Configuration. PR #1447 by @RunningIkkyu.
    • ๐ŸŒ Add Chinese translation for Advanced User Guide - Intro. PR #1445 by @RunningIkkyu.

    Internal

    • โšก๏ธ ๐Ÿ”ง Update TestDriven link to course in sponsors section. PR #2435 by @tiangolo.
    • โšก๏ธ ๐Ÿฑ Update sponsor logos. PR #2418 by @tiangolo.
    • ๐Ÿฑ ๐Ÿ’š Fix disabling install of Material for MkDocs Insiders in forks, strike 1 โšพ. PR #2340 by @tiangolo.
    • ๐Ÿฑ ๐Ÿ› Fix disabling Material for MkDocs Insiders install in forks. PR #2339 by @tiangolo.
    • ๐Ÿฑ โœจ Add silver sponsor WeTransfer. PR #2338 by @tiangolo.
    • ๐Ÿฑ โœจ Set up and enable Material for MkDocs Insiders for the docs. PR #2325 by @tiangolo.
  • v0.61.2 Changes

    November 05, 2020

    ๐Ÿ›  Fixes

    • ๐Ÿฑ ๐Ÿ“Œ Relax Swagger UI version pin. PR #2089 by @jmriebold.
    • ๐Ÿฑ ๐Ÿ› Fix bug overriding custom HTTPException and RequestValidationError from exception_handlers. PR #1924 by @uriyyo.
    • ๐Ÿฑ โœ๏ธ Fix typo on dependencies utils and cleanup unused variable. PR #1912 by @Kludex.

    ๐Ÿ“„ Docs

    • ๐Ÿฑ โœ๏ธ Fix typo in Tutorial - Path Parameters. PR #2231 by @mariacamilagl.
    • ๐Ÿฑ โœ Fix a stylistic error in docs. PR #2206 by @ddobrinskiy.
    • ๐Ÿฑ โœ Fix capitalizaiton typo in docs. PR #2204 by @imba-tjd.
    • ๐Ÿฑ โœ Fix typo in docs. PR #2179 by @ammarasmro.
    • โšก๏ธ ๐Ÿ“ Update/fix links in docs to use HTTPS. PR #2165 by @imba-tjd.
    • ๐Ÿฑ โœ Fix typos and add rewording in docs. PR #2159 by @nukopy.
    • ๐Ÿฑ ๐Ÿ“ Fix code consistency in examples for Tutorial - User Guide - Path Parameters. PR #2158 by @nukopy.
    • ๐Ÿฑ ๐Ÿ“ Fix renamed parameter content_type typo. PR #2135 by @TeoZosa.
    • ๐Ÿฑ โœ Fix minor typos in docs. PR #2122 by @TeoZosa.
    • ๐Ÿฑ โœ Fix typos in docs and source examples. PR #2102 by @AdrianDeAnda.
    • ๐Ÿฑ โœ Fix incorrect Celery URLs in docs. PR #2100 by @CircleOnCircles.
    • ๐Ÿฑ ๐Ÿ“ Simplify intro to Python Types, all currently supported Python versions include type hints ๐ŸŽ‰. PR #2085 by @ninjaaron.
    • ๐Ÿฑ ๐Ÿ“ Fix example code with sets in Tutorial - Body - Nested Models 3. PR #2054 by @hitrust.
    • ๐Ÿฑ ๐Ÿ“ Fix example code with sets in Tutorial - Body - Nested Models 2. PR #2053 by @hitrust.
    • ๐Ÿฑ ๐Ÿ“ Fix example code with sets in Tutorial - Body - Nested Models. PR #2052 by @hitrust.
    • ๐Ÿฑ โœ Fix typo in Benchmarks. PR #1995 by @AlejoAsd.
    • ๐Ÿ“ Add note in CORS tutorial about allow_origins with ["*"] and allow_credentials. PR #1895 by @dsmurrell.
    • ๐Ÿš€ ๐Ÿ“ Add deployment to Deta, the first gold sponsor ๐ŸŽ‰. PR #2303 by @tiangolo.
    • ๐Ÿ‘ฅ Update FastAPI People. PR #2282 by @github-actions[bot].
    • ๐Ÿฑ โœ๏ธ Fix uppercase in Tutorial - Query parameters. PR #2245 by @mariacamilagl.
    • ๐Ÿฑ ๐Ÿ“ Add articles to External Links. PR #2247 by @tiangolo.
    • ๐Ÿฑ โœ Fix typo in Spanish tutorial index. PR #2020 by @aviloncho.

    ๐ŸŒ Translations

    • ๐ŸŒ Add Japanese translation for Advanced Tutorial - Response Directly. PR #2191 by @Attsun1031.
    • ๐Ÿ”’ ๐Ÿ“ Add Japanese translation for Tutorial - Security - First Steps. PR #2153 by @komtaki.
    • ๐ŸŒ Add Japanese translation for Tutorial - Query Parameters and String Validations. PR #1901 by @SwftAlpc.
    • ๐ŸŒ Add Portuguese translation for External Links. PR #1443 by @Serrones.
    • ๐ŸŒ Add Japanese translation for Tutorial - CORS. PR #2125 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for Contributing. PR #2067 by @komtaki.
    • ๐ŸŒ Add Japanese translation for Project Generation. PR #2050 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for Alternatives. PR #2043 by @Attsun1031.
    • ๐ŸŒ Add Japanese translation for History Design and Future. PR #2002 by @komtaki.
    • ๐ŸŒ Add Japanese translation for Benchmarks. PR #1992 by @komtaki.
    • ๐ŸŒ Add Japanese translation for Tutorial - Header Parameters. PR #1935 by @SwftAlpc.
    • ๐ŸŒ Add Portuguese translation for Tutorial - First Steps. PR #1861 by @jessicapaz.
    • ๐ŸŒ Add Portuguese translation for Python Types. PR #1796 by @izaguerreiro.
    • ๐ŸŒ Add Japanese translation for Help FastAPI. PR #1692 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for Tutorial - Body. PR #1683 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for Tutorial - Query Params. PR #1674 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for tutorial/path-params.md. PR #1671 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for tutorial/first-steps.md. PR #1658 by @tokusumi.
    • ๐ŸŒ Add Japanese translation for tutorial/index.md. PR #1656 by @tokusumi.
    • ๐ŸŒ Add translation to Portuguese for Project Generation. PR #1602 by @Serrones.
    • ๐ŸŒ Add Japanese translation for Features. PR #1625 by @tokusumi.
    • ๐ŸŒ Initialize new language Korean for translations. PR #2018 by @hard-coders.
    • ๐ŸŒ Add Portuguese translation of Deployment. PR #1374 by @Serrones.

    Internal

    • โฌ†๏ธ ๐Ÿ”ฅ Cleanup after upgrade for Docs Previews GitHub Action. PR #2248 by @tiangolo.
    • ๐Ÿ‘ท ๐Ÿ› Fix CI docs preview, unzip docs. PR #2246 by @tiangolo.
    • ๐Ÿš€ โœจ Add instant docs deploy previews for PRs from forks. PR #2244 by @tiangolo.
    • ๐Ÿ— โšก๏ธ Build docs for languages in parallel in subprocesses to speed up CI. PR #2242 by @tiangolo.
    • ๐ŸŒ ๐Ÿ› Fix docs order generation for partial translations. PR #2238 by @tiangolo.
    • ๐Ÿ‘ฅ Update FastAPI People. PR #2202 by @github-actions[bot].
    • โšก๏ธ โ™ป๏ธ Update FastAPI People GitHub Action to send the PR as github-actions. PR #2201 by @tiangolo.
    • โšก๏ธ ๐Ÿ”ง Update FastAPI People GitHub Action config, run monthly. PR #2199 by @tiangolo.
    • ๐Ÿณ ๐Ÿ› Fix FastAPI People GitHub Action Docker dependency, strike 1 โšพ. PR #2198 by @tiangolo.
    • ๐Ÿณ ๐Ÿ› Fix FastAPI People GitHub Action Docker dependencies. PR #2197 by @tiangolo.
    • ๐Ÿฑ ๐Ÿ› Fix FastAPI People GitHub Action when there's nothing to change. PR #2196 by @tiangolo.
    • ๐Ÿ‘ฅ Add new section FastAPI People. PR #2195 by @tiangolo.
    • โฌ†๏ธ โฌ†๏ธ Upgrade GitHub Action Latest Changes. PR #2190 by @tiangolo.
    • โฌ†๏ธ โฌ†๏ธ Upgrade GitHub Action Label Approved. PR #2189 by @tiangolo.
    • โšก๏ธ ๐Ÿ”ง Update GitHub Action Label Approved, run at 12:00. PR #2185 by @tiangolo.
    • โฌ†๏ธ ๐Ÿ‘ท Upgrade GitHub Action Latest Changes. PR #2184 by @tiangolo.
    • ๐Ÿฑ ๐Ÿ‘ท Set GitHub Action Label Approved to run daily, not every minute. PR #2163 by @tiangolo.
    • ๐Ÿฑ ๐Ÿ”ฅ Remove pr-approvals GitHub Action as it's not compatible with forks. Use the new one. PR #2162 by @tiangolo.
    • ๐Ÿฑ ๐Ÿ‘ท Add GitHub Action Latest Changes. PR #2160.
    • ๐Ÿฑ ๐Ÿ‘ท Add GitHub Action Label Approved. PR #2161.
  • v0.61.1 Changes

    August 29, 2020

    ๐Ÿ›  Fixes

    • ๐Ÿ›  Fix issues using jsonable_encoder with SQLAlchemy models directly. PR #1987.

    ๐Ÿ“„ Docs

    ๐ŸŒ Translations

    Internal

    • ๐Ÿ‘Œ Improve docs maintainability by updating hl_lines syntax to use ranges. PR #1863 by @la-mar.
  • v0.61.0 Changes

    August 09, 2020

    ๐Ÿ”‹ Features

    • โž• Add support for injecting HTTPConnection (as Request and WebSocket). Useful for sharing app state in dependencies. PR #1827 by @nsidnev.
    • ๐Ÿ“„ Export WebSocketDisconnect and add example handling WebSocket disconnections to docs. PR #1822 by @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.
    • ๐Ÿšš 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.
      • PR #1864.

    ๐Ÿ“„ Docs

    Internal

    • โž• Add Flake8 linting. Original PR #1774 by @MashhadiNima.
    • Disable Gitter bot, as it's currently broken, and Gitter's response doesn't show the problem. PR #1853.
  • v0.60.2 Changes

    August 08, 2020
    • ๐Ÿ›  Fix typo in docs for query parameters. PR #1832 by @ycd.
    • โž• Add docs about Async Tests. PR #1619 by @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 based on original PR #1627 by @chrisngyn, @YKo20010, @kx-chen.
    • ๐Ÿš€ Re-enable Gitter releases bot. PR #1831.
    • โž• Add link to async SQL databases tutorial from main SQL tutorial. PR #1813 by @short2strings.
    • ๐Ÿ›  Fix typo in tutorial about behind a proxy. PR #1807 by @toidi.
    • ๐Ÿ›  Fix typo in Portuguese docs. PR #1795 by @izaguerreiro.
    • โž• Add translations setup for Ukrainian. PR #1830.
    • โž• Add external link Build And Host Fast Data Science Applications Using FastAPI. PR #1786 by @Kludex.
    • ๐Ÿ›  Fix encoding of Pydantic models that inherit from others models with custom json_encoders. PR #1769 by @henrybetts.
    • Simplify and improve jsonable_encoder. PR #1754 by @MashhadiNima.
    • Simplify internal code syntax in several points. PR #1753 by @uriyyo.
    • ๐Ÿ‘Œ Improve internal typing, declare Optional parameters. PR #1731 by @MashhadiNima.
    • โž• Add external link Deploy FastAPI on Azure App Service to docs. PR #1726 by @windson.
    • โž• Add link to Starlette docs about WebSocket testing. PR #1717 by @hellocoldworld.
    • ๐Ÿ”จ Refactor generating dependant, merge for loops. PR #1714 by @Bloodielie.
    • โšก๏ธ Update example for templates with Jinja to include HTML media type. PR #1690 by @frafra.
    • ๐Ÿ›  Fix typos in docs for security. PR #1678 by @nilslindemann.
    • ๐Ÿ›  Fix typos in docs for dependencies. PR #1675 by @nilslindemann.
    • ๐Ÿ›  Fix type annotation for **extra parameters in FastAPI. PR #1659 by @bharel.
    • โฌ†๏ธ Bump MkDocs Material to fix docs in browsers with dark mode. PR #1789 by @adriencaccia.
    • โœ‚ Remove docs preview comment from each commit. PR #1826.
    • โšก๏ธ Update GitHub context extraction for Gitter notification bot. PR #1766.
  • v0.60.1 Changes

    July 22, 2020
    • โž• Add debugging logs for GitHub actions to introspect GitHub hidden context. PR #1764.
    • ๐Ÿ“„ Use OS preference theme for online docs. PR #1760 by @adriencaccia.
    • โฌ†๏ธ Upgrade Starlette to version 0.13.6 to handle a vulnerability when using static files in Windows. PR #1759 by @jamesag26.
    • ๐Ÿ“Œ Pin Swagger UI temporarily, waiting for a fix for swagger-api/swagger-ui#6249. PR #1763.
    • โšก๏ธ Update GitHub Actions, use commit from PR for docs preview, not commit from pre-merge. PR #1761.
    • ๐Ÿ”จ Update GitHub Actions, refactor Gitter bot. PR #1746.
  • v0.60.0 Changes

    July 20, 2020
    • โž• Add GitHub Action to watch for missing preview docs and trigger a preview deploy. PR #1740.
    • โž• Add custom GitHub Action to get artifact with docs preview. PR #1739.
    • โž• Add new GitHub Actions to preview docs from PRs. PR #1738.
    • โž• Add XML test coverage to support GitHub Actions. PR #1737.
    • โšก๏ธ Update badges and remove Travis now that GitHub Actions is the main CI. PR #1736.
    • โž• Add GitHub Actions for CI, move from Travis. PR #1735.
    • โž• Add support for adding OpenAPI schema for GET requests with a body. PR #1626 by @victorphoenix3.
  • v0.59.0 Changes

    July 10, 2020
    • ๐Ÿ›  Fix typo in docstring for OAuth2 utils. PR #1621 by @tomarv2.
    • โšก๏ธ Update JWT docs to use Python-jose instead of PyJWT. Initial PR #1610 by @asheux.
    • ๐Ÿ›  Fix/re-enable search bar in docs. PR #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.
      • 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 by @rkbeatss.
    • ๐Ÿ›  Fix typo/link in External Links. PR #1702.
    • โšก๏ธ Update handling of 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.
    • โž• Add external link Machine learning model serving in Python using FastAPI and Streamlit to docs. PR #1669 by @davidefiocco.
    • โž• Add note in docs on order in Pydantic Unions. PR #1591 by @kbanc.
    • ๐Ÿ‘Œ Improve support for tests in editor. PR #1699.
    • ๐Ÿ“Œ Pin dependencies. PR #1697.
    • โšก๏ธ Update isort to version 5.x.x. PR #1670 by @asheux.
  • v0.58.1 Changes

    June 28, 2020
  • v0.58.0 Changes

    June 15, 2020
    • ๐Ÿ“‡ Deep merge OpenAPI responses to preserve all the additional metadata. PR #1577.
    • ๐Ÿ“„ Mention in docs that only main app events are run (not sub-apps). PR #1554 by @amacfie.
    • ๐Ÿ›  Fix body validation error response, do not include body variable when it is not embedded. PR #1553 by @amacfie.
    • ๐Ÿ›  Fix testing OAuth2 security scopes when using dependency overrides. PR #1549 by @amacfie.
    • ๐Ÿ›  Fix Model for JSON Schema keyword not as a JSON Schema instead of a list. PR #1548 by @v-do.
    • โž• Add support for OpenAPI servers. PR #1547 by @mikaello.