24 KiB
Next release
- Add support for Pydantic's
skip_defaults:- There's a new path operation decorator parameter
response_model_skip_defaults.- The name of the parameter will most probably change in a future version to
response_skip_defaults,model_skip_defaultsor something similar.
- The name of the parameter will most probably change in a future version to
- New documentation section about using
response_model_skip_defaults. - PR #248 by @wshayes.
- There's a new path operation decorator parameter
0.24.0
-
Add support for WebSockets with dependencies and parameters.
- Support included for:
DependsSecurityCookieHeaderPathQuery- ...as these are compatible with the WebSockets protocol (e.g.
Bodyis not).
- Updated documentation for WebSockets.
- PR #178 by @jekirl.
- Support included for:
-
Upgrade the compatible version of Pydantic to
0.26.0.
0.23.0
-
Upgrade the compatible version of Starlette to
0.12.0.- This includes support for ASGI 3 (the latest version of the standard).
- It's now possible to use Starlette's
StreamingResponsewith iterators, like file-like objects (as those returned byopen()). - It's now possible to use the low level utility
iterate_in_threadpoolfromstarlette.concurrency(for advanced scenarios). - PR #243.
-
Add OAuth2 redirect page for Swagger UI. This allows having delegated authentication in the Swagger UI docs. For this to work, you need to add
{your_origin}/docs/oauth2-redirectto the allowed callbacks in your OAuth2 provider (in Auth0, Facebook, Google, etc).- For example, during development, it could be
http://localhost:8000/docs/oauth2-redirect. - Have in mind that this callback URL is independent of whichever one is used by your frontend. You might also have another callback at
https://yourdomain.com/login/callback. - This is only to allow delegated authentication in the API docs with Swagger UI.
- PR #198 by @steinitzu.
- For example, during development, it could be
-
Make Swagger UI and ReDoc route handlers (path operations) be
asyncfunctions instead of lambdas to improve performance. PR #241 by @Trim21. -
Make Swagger UI and ReDoc URLs parameterizable, allowing to host and serve local versions of them and have offline docs. PR #112 by @euri10.
0.22.0
-
Add support for
dependenciesparameter:- A parameter in path operation decorators, for dependencies that should be executed but the return value is not important or not used in the path operation function.
- A parameter in the
.include_router()method of FastAPI applications and routers, to include dependencies that should be executed in each path operation in a router.- This is useful, for example, to require authentication or permissions in specific group of path operations.
- Different
dependenciescan be applied to different routers.
- These
dependenciesare run before the normal parameter dependencies. And normal dependencies are run too. They can be combined. - Dependencies declared in a router are executed first, then the ones defined in path operation decorators, and then the ones declared in normal parameters. They are all combined and executed.
- All this also supports using
Securitywithscopesin thosedependenciesparameters, for more advanced OAuth 2.0 security scenarios with scopes. - New documentation about dependencies in path operation decorators.
- New documentation about dependencies in the
include_router()method. - PR #235.
-
Fix OpenAPI documentation of Starlette URL convertors. Specially useful when using
pathconvertors, to take a whole path as a parameter, like/some/url/{p:path}. PR #234 by @euri10. -
Make default parameter utilities exported from
fastapibe functions instead of classes (the new functions return instances of those classes). To be able to override the return types and fixmypyerrors in FastAPI's users' code. Applies toPath,Query,Header,Cookie,Body,Form,File,Depends, andSecurity. PR #226 and PR #231. -
Separate development scripts
test.sh,lint.sh, andformat.sh. PR #232. -
Re-enable
blackformatting checks for Python 3.7. PR #229 by @zamiramir.
0.21.0
-
On body parsing errors, raise
fromprevious exception, to allow better introspection in logging code. PR #192 by @ricardomomm. -
Use Python logger named "
fastapi" instead of root logger. PR #222 by @euri10. -
Fix typo in routing. PR #221 by @djlambert.
0.20.1
-
Add typing information to package including file
py.typed. PR #209 by @meadsteve. -
Add FastAPI bot for Gitter. To automatically announce new releases. PR #189.
0.20.0
-
Upgrade OAuth2:
- Upgrade Password flow using Bearer tokens to use the correct HTTP status code 401
UNAUTHORIZED, withWWW-Authenticateheaders. - Update, simplify, and improve all the security docs.
- Add new
scope_strtoSecurityScopesand update docs: OAuth2 scopes. - Update docs, images, tests.
- PR #188.
- Upgrade Password flow using Bearer tokens to use the correct HTTP status code 401
-
Include Hypercorn as an alternative ASGI server in the docs. PR #187.
-
Add docs for Static Files and Templates. PR #186.
-
Add docs for handling Response Cookies and Response Headers. PR #185.
0.19.0
-
Rename path operation decorator parameter
content_typetoresponse_class. PR #183. -
Add docs:
- How to use the
jsonable_encoderin JSON compatible encoder. - How to Return a Response directly.
- Update how to use a Custom Response Class.
- PR #184.
- How to use the
0.18.0
-
Add docs for HTTP Basic Auth. PR #177.
-
Upgrade HTTP Basic Auth handling with automatic headers (automatic browser login prompt). PR #175.
-
Update dependencies for security. PR #174.
-
Add docs for Middleware. PR #173.
0.17.0
-
Make Flit publish from CI. PR #170.
-
Add documentation about handling CORS (Cross-Origin Resource Sharing). PR #169.
-
By default, encode by alias. This allows using Pydantic
aliasparameters working by default. PR #168.
0.16.0
-
Upgrade path operation
doctsringparsing to support proper Markdown descriptions. New documentation at Path Operation Configuration. PR #163. -
Refactor internal usage of Pydantic to use correct data types. PR #164.
-
Fix typo in Tutorial about Extra Models. PR #159 by @danielmichaels.
-
Fix Query Parameters URL examples in docs. PR #157 by @hayata-yamamoto.
0.15.0
-
Add support for multiple file uploads (as a single form field). New docs at: Multiple file uploads. PR #158.
-
Add docs for: Additional Status Codes. PR #156.
0.14.0
-
Improve automatically generated names of path operations in OpenAPI (in API docs). A function
read_itemsinstead of having a generated name "Read Items Get" will have "Read Items". PR #155. -
Add docs for: Testing FastAPI. PR #151.
-
Update
/docsSwagger UI to enable deep linking. This allows sharing the URL pointing directly to the path operation documentation in the docs. PR #148 by @wshayes. -
Update development dependencies,
Pipfile.lock. PR #150. -
Include Falcon and Hug in: Alternatives, Inspiration and Comparisons.
0.13.0
- Improve/upgrade OAuth2 scopes support with
SecurityScopes:SecurityScopescan be declared as a parameter likeRequest, to get the scopes of all super-dependencies/dependants.- Improve
Securityhandling, merging scopes when declaringSecurityScopes. - Allow using
SecurityBase(likeOAuth2) classes withDependsand still document them.Securitynow is needed only to declarescopes. - Updated docs about: OAuth2 with Password (and hashing), Bearer with JWT tokens.
- New docs about: OAuth2 scopes.
- PR #141.
0.12.1
-
Fix bug: handling additional
responsesinAPIRouter.include_router(). PR #140. -
Fix typo in SQL tutorial. PR #138 by @mostaphaRoudsari.
-
Fix typos in section about nested models and OAuth2 with JWT. PR #127 by @mmcloud.
0.12.0
- Add additional
responsesparameter to path operation decorators to extend responses in OpenAPI (and API docs).- It also allows extending existing responses generated from
response_model, declare other media types (like images), etc. - The new documentation is here: Additional Responses.
responsescan also be added to.include_router(), the updated docs are here: Bigger Applications.- PR #97 originally initiated by @barsi.
- It also allows extending existing responses generated from
- Update
scripts/test-cov-html.shto allow passing extra parameters like-vv, for development.
0.11.0
-
Add
auto_errorparameter to security utility functions. Allowing them to be optional. Also allowing to have multiple alternative security schemes that are then checked in a single dependency instead of each one verifying and returning the error to the client automatically when not satisfied. PR #134. -
Update SQL Tutorial to close database sessions even when there are exceptions. PR #89 by @alexiri.
-
Fix duplicate dependency in
pyproject.toml. PR #128 by @zxalif.
0.10.3
-
Add Gitter chat, badge, links, etc. https://gitter.im/tiangolo/fastapi . PR #117.
-
Add docs about Extending OpenAPI. PR #126.
-
Make Travis run Ubuntu Xenial (newer version) and Python 3.7 instead of Python 3.7-dev. PR #92 by @blueyed.
-
Fix duplicated param variable creation. PR #123 by @yihuang.
-
Add note in Response Model docs about why using a function parameter instead of a function return type annotation. PR #109 by @JHSaunders.
-
Fix event docs (startup/shutdown) function name. PR #105 by @stratosgear.
0.10.2
-
Fix OpenAPI (JSON Schema) for declarations of Python
Union(JSON SchemaadditionalProperties). PR #121. -
Update Background Tasks with a note on Celery.
-
Document response models using unions and lists, updated at: Extra Models. PR #108.
0.10.1
- Add docs and tests for encode/databases. New docs at: Async SQL (Relational) Databases. PR #107.
0.10.0
-
Add support for Background Tasks in path operation functions and dependencies. New documentation about Background Tasks is here. PR #103.
-
Add support for
.websocket_route()inAPIRouter. PR #100 by @euri10. -
New docs section about Events: startup - shutdown. PR #99.
0.9.1
- Document receiving Multiple values with the same query parameter and Duplicate headers. PR #95.
0.9.0
-
Upgrade compatible Pydantic version to
0.21.0. PR #90. -
Add documentation for: Application Configuration.
-
Fix typo in docs. PR #76 by @matthewhegarty.
-
Fix link in "Deployment" to "Bigger Applications".
0.8.0
-
Add support for adding
tagsinapp.include_router(). PR #55 by @euri10. Documentation updated in the section: Bigger Applications. -
Update docs related to Uvicorn to use new
--reloadoption from version0.5.x. PR #74. -
Update
isortimports and scripts to be compatible with newer versions. PR #75.
0.7.1
-
Update technical details about
async defhandling with respect to previous frameworks. PR #64 by @haizaar. -
Add deployment documentation for Docker in Raspberry Pi and other architectures.
-
Trigger Docker images build on Travis CI automatically. PR #65.
0.7.0
- Add support for
UploadFileinFileparameter annotations.- This includes a file-like interface.
- Here's the updated documentation for declaring
Fileparameters withUploadFile. - And here's the updated documentation for using
Formparameters mixed withFileparameters, supportingbytesandUploadFileat the same time. - PR #63.
0.6.4
-
Add technical details about
async defhandling to docs. PR #61. -
Add docs for Debugging FastAPI applications in editors.
-
Fix typos in docs.
-
Add section about History, Design and Future.
-
Add docs for using WebSockets with FastAPI. PR #62.
0.6.3
- Add Favicons to docs. PR #53.
0.6.2
-
Introduce new project generator based on FastAPI and PostgreSQL: https://github.com/tiangolo/full-stack-fastapi-postgresql. PR #52.
-
Update SQL tutorial with SQLAlchemy, using
Dependsto improve editor support and reduce code repetition. PR #52. -
Improve middleware naming in tutorial for SQL with SQLAlchemy https://fastapi.tiangolo.com/tutorial/sql-databases/.
0.6.1
- Add docs for GraphQL: https://fastapi.tiangolo.com/tutorial/graphql/. PR #48.
0.6.0
-
Update SQL with SQLAlchemy tutorial at https://fastapi.tiangolo.com/tutorial/sql-databases/ using the new official
request.state. PR #45. -
Upgrade Starlette to version
0.11.1and add required compatibility changes. PR #44.
0.5.1
-
Add section about helping and getting help with FastAPI.
-
Add note about path operations order in docs.
-
Update section about error handling with more information and make relation with Starlette error handling utilities more explicit. PR #41.
0.5.0
-
Add new
HTTPExceptionwith support for custom headers. With new documentation for handling errors at: https://fastapi.tiangolo.com/tutorial/handling-errors/. PR #35. -
Add documentation to use Starlette
Requestobject directly. Check #25 by @euri10. -
Add issue templates to simplify reporting bugs, getting help, etc: #34.
-
Update example for the SQLAlchemy tutorial at https://fastapi.tiangolo.com/tutorial/sql-databases/ using middleware and database session attached to request.
0.4.0
-
Add
openapi_prefix, support for reverse proxy and mounting sub-applications. See the docs at https://fastapi.tiangolo.com/tutorial/sub-applications-proxy/: #26 by @kabirkhan. -
Update docs/tutorial for SQLAlchemy including note about DB Browser for SQLite.
0.3.0
- Fix/add SQLAlchemy support, including ORM, and update docs for SQLAlchemy: #30.
0.2.1
- Fix
jsonable_encoderfor Pydantic models withConfigbut withoutjson_encoders: #29.