diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 9e71a461a..a4bf322f4 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Download Artifact Docs - uses: dawidd6/action-download-artifact@v2.21.1 + uses: dawidd6/action-download-artifact@v2.22.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} workflow: build-docs.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6944e4a25..6e51622e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v2.37.1 + rev: v2.37.3 hooks: - id: pyupgrade args: diff --git a/README.md b/README.md index 326ad2279..390fc3033 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ FastAPI is a modern, fast (high-performance), web framework for building APIs wi The key features are: * **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance). - * **Fast to code**: Increase the speed to develop features by about 200% to 300%. * * **Fewer bugs**: Reduce about 40% of human (developer) induced errors. * * **Intuitive**: Great editor support. Completion everywhere. Less time debugging. diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml index 4a5791a43..e7bd0530b 100644 --- a/docs/en/data/external_links.yml +++ b/docs/en/data/external_links.yml @@ -212,6 +212,10 @@ articles: author_link: https://twitter.com/MantoshMukul link: https://www.jetbrains.com/pycharm/guide/tutorials/fastapi-aws-kubernetes/ title: Developing FastAPI Application using K8s & AWS + - author: KrishNa + author_link: https://medium.com/@krishnardt365 + link: https://medium.com/@krishnardt365/fastapi-docker-and-postgres-91943e71be92 + title: Fastapi, Docker(Docker compose) and Postgres german: - author: Nico Axtmann author_link: https://twitter.com/_nicoax diff --git a/docs/en/docs/advanced/additional-responses.md b/docs/en/docs/advanced/additional-responses.md index 5d136da41..dca5f6a98 100644 --- a/docs/en/docs/advanced/additional-responses.md +++ b/docs/en/docs/advanced/additional-responses.md @@ -23,7 +23,7 @@ Each of those response `dict`s can have a key `model`, containing a Pydantic mod For example, to declare another response with a status code `404` and a Pydantic model `Message`, you can write: -```Python hl_lines="18 23" +```Python hl_lines="18 22" {!../../../docs_src/additional_responses/tutorial001.py!} ``` diff --git a/docs/en/docs/advanced/openapi-callbacks.md b/docs/en/docs/advanced/openapi-callbacks.md index 138c90dd7..656ddbb3f 100644 --- a/docs/en/docs/advanced/openapi-callbacks.md +++ b/docs/en/docs/advanced/openapi-callbacks.md @@ -31,7 +31,7 @@ It will have a *path operation* that will receive an `Invoice` body, and a query This part is pretty normal, most of the code is probably already familiar to you: -```Python hl_lines="10-14 37-54" +```Python hl_lines="9-13 36-53" {!../../../docs_src/openapi_callbacks/tutorial001.py!} ``` @@ -83,7 +83,7 @@ So we are going to use that same knowledge to document how the *external API* sh First create a new `APIRouter` that will contain one or more callbacks. -```Python hl_lines="5 26" +```Python hl_lines="3 25" {!../../../docs_src/openapi_callbacks/tutorial001.py!} ``` @@ -96,7 +96,7 @@ It should look just like a normal FastAPI *path operation*: * It should probably have a declaration of the body it should receive, e.g. `body: InvoiceEvent`. * And it could also have a declaration of the response it should return, e.g. `response_model=InvoiceEventReceived`. -```Python hl_lines="17-19 22-23 29-33" +```Python hl_lines="16-18 21-22 28-32" {!../../../docs_src/openapi_callbacks/tutorial001.py!} ``` @@ -163,7 +163,7 @@ At this point you have the *callback path operation(s)* needed (the one(s) that Now use the parameter `callbacks` in *your API's path operation decorator* to pass the attribute `.routes` (that's actually just a `list` of routes/*path operations*) from that callback router: -```Python hl_lines="36" +```Python hl_lines="35" {!../../../docs_src/openapi_callbacks/tutorial001.py!} ``` diff --git a/docs/en/docs/async.md b/docs/en/docs/async.md index dc8e10bb8..c14a2cbb7 100644 --- a/docs/en/docs/async.md +++ b/docs/en/docs/async.md @@ -26,7 +26,7 @@ async def read_results(): --- -If you are using a third party library that communicates with something (a database, an API, the file system, etc) and doesn't have support for using `await`, (this is currently the case for most database libraries), then declare your *path operation functions* as normally, with just `def`, like: +If you are using a third party library that communicates with something (a database, an API, the file system, etc.) and doesn't have support for using `await`, (this is currently the case for most database libraries), then declare your *path operation functions* as normally, with just `def`, like: ```Python hl_lines="2" @app.get('/') @@ -45,7 +45,7 @@ If you just don't know, use normal `def`. --- -**Note**: you can mix `def` and `async def` in your *path operation functions* as much as you need and define each one using the best option for you. FastAPI will do the right thing with them. +**Note**: You can mix `def` and `async def` in your *path operation functions* as much as you need and define each one using the best option for you. FastAPI will do the right thing with them. Anyway, in any of the cases above, FastAPI will still work asynchronously and be extremely fast. @@ -397,7 +397,7 @@ All that is what powers FastAPI (through Starlette) and what makes it have such These are very technical details of how **FastAPI** works underneath. - If you have quite some technical knowledge (co-routines, threads, blocking, etc) and are curious about how FastAPI handles `async def` vs normal `def`, go ahead. + If you have quite some technical knowledge (co-routines, threads, blocking, etc.) and are curious about how FastAPI handles `async def` vs normal `def`, go ahead. ### Path operation functions diff --git a/docs/en/docs/contributing.md b/docs/en/docs/contributing.md index 648c472fe..ca51c6e82 100644 --- a/docs/en/docs/contributing.md +++ b/docs/en/docs/contributing.md @@ -84,7 +84,17 @@ To check it worked, use: If it shows the `pip` binary at `env/bin/pip` then it worked. 🎉 +Make sure you have the latest pip version on your virtual environment to avoid errors on the next steps: +
+ +```console +$ python -m pip install --upgrade pip + +---> 100% +``` + +
!!! tip Every time you install a new package with `pip` under that environment, activate the environment again. diff --git a/docs/en/docs/features.md b/docs/en/docs/features.md index e4672d532..02bb3ac1f 100644 --- a/docs/en/docs/features.md +++ b/docs/en/docs/features.md @@ -195,6 +195,6 @@ With **FastAPI** you get all of **Pydantic**'s features (as FastAPI is based on * Use of hierarchical Pydantic models, Python `typing`’s `List` and `Dict`, etc. * And validators allow complex data schemas to be clearly and easily defined, checked and documented as JSON Schema. * You can have deeply **nested JSON** objects and have them all validated and annotated. -* **Extendible**: +* **Extensible**: * Pydantic allows custom data types to be defined or you can extend validation with methods on a model decorated with the validator decorator. * 100% test coverage. diff --git a/docs/en/docs/index.md b/docs/en/docs/index.md index 17163ba01..24ce14e23 100644 --- a/docs/en/docs/index.md +++ b/docs/en/docs/index.md @@ -32,7 +32,6 @@ FastAPI is a modern, fast (high-performance), web framework for building APIs wi The key features are: * **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance). - * **Fast to code**: Increase the speed to develop features by about 200% to 300%. * * **Fewer bugs**: Reduce about 40% of human (developer) induced errors. * * **Intuitive**: Great editor support. Completion everywhere. Less time debugging. diff --git a/docs/en/docs/python-types.md b/docs/en/docs/python-types.md index 3b0ee4cf6..3d22ee620 100644 --- a/docs/en/docs/python-types.md +++ b/docs/en/docs/python-types.md @@ -158,7 +158,7 @@ The syntax using `typing` is **compatible** with all versions, from Python 3.6 t As Python advances, **newer versions** come with improved support for these type annotations and in many cases you won't even need to import and use the `typing` module to declare the type annotations. -If you can chose a more recent version of Python for your project, you will be able to take advantage of that extra simplicity. See some examples below. +If you can choose a more recent version of Python for your project, you will be able to take advantage of that extra simplicity. See some examples below. #### List @@ -372,7 +372,7 @@ These types that take type parameters in square brackets are called **Generic ty === "Python 3.9 and above" - You can use the same builtin types as generics (with square brakets and types inside): + You can use the same builtin types as generics (with square brackets and types inside): * `list` * `tuple` @@ -387,7 +387,7 @@ These types that take type parameters in square brackets are called **Generic ty === "Python 3.10 and above" - You can use the same builtin types as generics (with square brakets and types inside): + You can use the same builtin types as generics (with square brackets and types inside): * `list` * `tuple` diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 806127162..ebd9de50b 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,8 +2,58 @@ ## Latest Changes + +## 0.81.0 + +### Features + +* ✨ Add ReDoc `