diff --git a/docs/en/docs/_llm-test.md b/docs/en/docs/_llm-test.md index 946443e68d..603474cfc6 100644 --- a/docs/en/docs/_llm-test.md +++ b/docs/en/docs/_llm-test.md @@ -488,7 +488,7 @@ For some language specific instructions, see e.g. section `### Headings` in `doc //// tab | Info -This is a not complete and not normative list of (mostly) technical terms seen in the docs. It may be helpful for the prompt designer to figure out for which terms the LLM needs a helping hand. For example when it keeps reverting a good translation to a suboptimal translation. Or when it has problems conjugating/declinating a term in your language. +This is neither a complete nor a normative list of (mostly) technical terms seen in the docs. It may be helpful for the prompt designer to figure out for which terms the LLM needs a helping hand. For example when it keeps reverting a good translation to a suboptimal translation. Or when it has problems conjugating/declinating a term in your language. See e.g. section `### List of English terms and their preferred German translations` in `docs/de/llm-prompt.md`. diff --git a/docs/en/docs/advanced/advanced-dependencies.md b/docs/en/docs/advanced/advanced-dependencies.md index 030fe8548a..5d72e8e19a 100644 --- a/docs/en/docs/advanced/advanced-dependencies.md +++ b/docs/en/docs/advanced/advanced-dependencies.md @@ -112,7 +112,7 @@ For example, imagine you have code that uses a database session in a dependency In this case, the database session would be held until the response is finished being sent, but if you don't use it, then it wouldn't be necessary to hold it. -Here's how it could look like: +Here's what it could look like: {* ../../docs_src/dependencies/tutorial013_an_py310.py *} diff --git a/docs/en/docs/advanced/events.md b/docs/en/docs/advanced/events.md index 3e65854e7b..8f8cdb0176 100644 --- a/docs/en/docs/advanced/events.md +++ b/docs/en/docs/advanced/events.md @@ -142,7 +142,7 @@ So, we declare the event handler function with standard `def` instead of `async There's a high chance that the logic for your *startup* and *shutdown* is connected, you might want to start something and then finish it, acquire a resource and then release it, etc. -Doing that in separated functions that don't share logic or variables together is more difficult as you would need to store values in global variables or similar tricks. +Doing that in separate functions that don't share logic or variables together is more difficult as you would need to store values in global variables or similar tricks. Because of that, it's now recommended to instead use the `lifespan` as explained above. diff --git a/docs/en/docs/advanced/openapi-callbacks.md b/docs/en/docs/advanced/openapi-callbacks.md index e8ff016963..492afb84c5 100644 --- a/docs/en/docs/advanced/openapi-callbacks.md +++ b/docs/en/docs/advanced/openapi-callbacks.md @@ -4,7 +4,7 @@ You could create an API with a *path operation* that could trigger a request to The process that happens when your API app calls the *external API* is named a "callback". Because the software that the external developer wrote sends a request to your API and then your API *calls back*, sending a request to an *external API* (that was probably created by the same developer). -In this case, you could want to document how that external API *should* look like. What *path operation* it should have, what body it should expect, what response it should return, etc. +In this case, you could want to document what that external API *should* look like. What *path operation* it should have, what body it should expect, what response it should return, etc. ## An app with callbacks { #an-app-with-callbacks } @@ -25,7 +25,7 @@ Then your API will (let's imagine): ## The normal **FastAPI** app { #the-normal-fastapi-app } -Let's first see how the normal API app would look like before adding the callback. +Let's first see what the normal API app would look like before adding the callback. It will have a *path operation* that will receive an `Invoice` body, and a query parameter `callback_url` that will contain the URL for the callback. @@ -56,7 +56,7 @@ httpx.post(callback_url, json={"description": "Invoice paid", "paid": True}) But possibly the most important part of the callback is making sure that your API user (the external developer) implements the *external API* correctly, according to the data that *your API* is going to send in the request body of the callback, etc. -So, what we will do next is add the code to document how that *external API* should look like to receive the callback from *your API*. +So, what we will do next is add the code to document what that *external API* should look like to receive the callback from *your API*. That documentation will show up in the Swagger UI at `/docs` in your API, and it will let external developers know how to build the *external API*. @@ -72,11 +72,11 @@ When implementing the callback yourself, you could use something like [HTTPX](ht ## Write the callback documentation code { #write-the-callback-documentation-code } -This code won't be executed in your app, we only need it to *document* how that *external API* should look like. +This code won't be executed in your app, we only need it to *document* what that *external API* should look like. But, you already know how to easily create automatic documentation for an API with **FastAPI**. -So we are going to use that same knowledge to document how the *external API* should look like... by creating the *path operation(s)* that the external API should implement (the ones your API will call). +So we are going to use that same knowledge to document what the *external API* should look like... by creating the *path operation(s)* that the external API should implement (the ones your API will call). /// tip @@ -181,6 +181,6 @@ Notice that you are not passing the router itself (`invoices_callback_router`) t Now you can start your app and go to [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs). -You will see your docs including a "Callbacks" section for your *path operation* that shows how the *external API* should look like: +You will see your docs including a "Callbacks" section for your *path operation* that shows what the *external API* should look like: diff --git a/docs/en/docs/advanced/response-change-status-code.md b/docs/en/docs/advanced/response-change-status-code.md index 3016889437..747016722c 100644 --- a/docs/en/docs/advanced/response-change-status-code.md +++ b/docs/en/docs/advanced/response-change-status-code.md @@ -26,6 +26,6 @@ And then you can return any object you need, as you normally would (a `dict`, a And if you declared a `response_model`, it will still be used to filter and convert the object you returned. -**FastAPI** will use that *temporal* response to extract the status code (also cookies and headers), and will put them in the final response that contains the value you returned, filtered by any `response_model`. +**FastAPI** will use that *temporary* response to extract the status code (also cookies and headers), and will put them in the final response that contains the value you returned, filtered by any `response_model`. You can also declare the `Response` parameter in dependencies, and set the status code in them. But keep in mind that the last one to be set will win. diff --git a/docs/en/docs/advanced/response-cookies.md b/docs/en/docs/advanced/response-cookies.md index 904ac26fd7..f523a5c63c 100644 --- a/docs/en/docs/advanced/response-cookies.md +++ b/docs/en/docs/advanced/response-cookies.md @@ -12,7 +12,7 @@ And then you can return any object you need, as you normally would (a `dict`, a And if you declared a `response_model`, it will still be used to filter and convert the object you returned. -**FastAPI** will use that *temporal* response to extract the cookies (also headers and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`. +**FastAPI** will use that *temporary* response to extract the cookies (also headers and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`. You can also declare the `Response` parameter in dependencies, and set cookies (and headers) in them. diff --git a/docs/en/docs/advanced/response-headers.md b/docs/en/docs/advanced/response-headers.md index 49032c8003..cbc28e4959 100644 --- a/docs/en/docs/advanced/response-headers.md +++ b/docs/en/docs/advanced/response-headers.md @@ -12,7 +12,7 @@ And then you can return any object you need, as you normally would (a `dict`, a And if you declared a `response_model`, it will still be used to filter and convert the object you returned. -**FastAPI** will use that *temporal* response to extract the headers (also cookies and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`. +**FastAPI** will use that *temporary* response to extract the headers (also cookies and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`. You can also declare the `Response` parameter in dependencies, and set headers (and cookies) in them. diff --git a/docs/en/docs/advanced/security/oauth2-scopes.md b/docs/en/docs/advanced/security/oauth2-scopes.md index 9346cd5450..60e900d2cd 100644 --- a/docs/en/docs/advanced/security/oauth2-scopes.md +++ b/docs/en/docs/advanced/security/oauth2-scopes.md @@ -198,7 +198,7 @@ As the `get_current_active_user` dependency has `get_current_user` as a sub-depe The *path operation* itself also declares a scope, `"items"`, so this will also be in the list of `security_scopes.scopes` passed to `get_current_user`. -Here's how the hierarchy of dependencies and scopes looks like: +Here's what the hierarchy of dependencies and scopes looks like: * The *path operation* `read_own_items` has: * Required scopes `["items"]` with the dependency: diff --git a/docs/en/docs/deployment/concepts.md b/docs/en/docs/deployment/concepts.md index 138c433f9b..fc99c2247e 100644 --- a/docs/en/docs/deployment/concepts.md +++ b/docs/en/docs/deployment/concepts.md @@ -36,9 +36,9 @@ And there has to be something in charge of **renewing the HTTPS certificates**, Some of the tools you could use as a TLS Termination Proxy are: * Traefik - * Automatically handles certificates renewals ✨ + * Automatically handles certificate renewals ✨ * Caddy - * Automatically handles certificates renewals ✨ + * Automatically handles certificate renewals ✨ * Nginx * With an external component like Certbot for certificate renewals * HAProxy diff --git a/docs/en/docs/deployment/docker.md b/docs/en/docs/deployment/docker.md index f913ae1fee..bdc0351d03 100644 --- a/docs/en/docs/deployment/docker.md +++ b/docs/en/docs/deployment/docker.md @@ -519,7 +519,7 @@ Here are some examples of when that could make sense: #### A Simple App { #a-simple-app } -You could want a process manager in the container if your application is **simple enough** that can run it on a **single server**, not a cluster. +You could want a process manager in the container if your application is **simple enough** that you can run it on a **single server**, not a cluster. #### Docker Compose { #docker-compose } diff --git a/docs/en/docs/deployment/https.md b/docs/en/docs/deployment/https.md index 886dfbe788..8280c1173d 100644 --- a/docs/en/docs/deployment/https.md +++ b/docs/en/docs/deployment/https.md @@ -59,7 +59,7 @@ The idea is to automate the acquisition and renewal of these certificates so tha ## HTTPS for Developers { #https-for-developers } -Here's an example of how an HTTPS API could look like, step by step, paying attention mainly to the ideas important for developers. +Here's an example of how an HTTPS API could look, step by step, paying attention mainly to the ideas important for developers. ### Domain Name { #domain-name } diff --git a/docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md b/docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md index 56a99f6a46..5c45d8e0a3 100644 --- a/docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md +++ b/docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md @@ -88,7 +88,7 @@ graph TB style V2Field fill:#f9fff3 ``` -...but, you can have separated models using Pydantic v1 and v2 in the same app. +...but you can have separate models, some using Pydantic v1 and others using Pydantic v2, in the same app. ```mermaid graph TB diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index d890ca1324..d7c6268a7d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -6106,7 +6106,7 @@ Note: all the previous parameters are still there, so it's still possible to dec * [Using FastAPI with Django](https://www.stavros.io/posts/fastapi-with-django/) by [Stavros Korokithakis](https://x.com/Stavros). * [Introducing Dispatch](https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072) by [Netflix](https://netflixtechblog.com/). * **Podcasts**: - * [Build The Next Generation Of Python Web Applications With FastAPI - Episode 259 - interview to Sebastían Ramírez (tiangolo)](https://www.pythonpodcast.com/fastapi-web-application-framework-episode-259/) by [Podcast.`__init__`](https://www.pythonpodcast.com/). + * [Build The Next Generation Of Python Web Applications With FastAPI - Episode 259 - interview to Sebastián Ramírez (tiangolo)](https://www.pythonpodcast.com/fastapi-web-application-framework-episode-259/) by [Podcast.`__init__`](https://www.pythonpodcast.com/). * **Talks**: * [PyConBY 2020: Serve ML models easily with FastAPI](https://www.youtube.com/watch?v=z9K5pwb0rt8) by [Sebastián Ramírez (tiangolo)](https://x.com/tiangolo). * [[VIRTUAL] Py.Amsterdam's flying Software Circus: Intro to FastAPI](https://www.youtube.com/watch?v=PnpTY1f4k2U) by [Sebastián Ramírez (tiangolo)](https://x.com/tiangolo). @@ -6655,7 +6655,7 @@ Note: all the previous parameters are still there, so it's still possible to dec * Add support for `dependencies` parameter: * 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*. + * This is useful, for example, to require authentication or permissions in a specific group of *path operations*. * Different `dependencies` can be applied to different routers. * These `dependencies` are 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. diff --git a/docs/en/docs/translations.md b/docs/en/docs/translations.md index c05b04ed7d..2f1067255e 100644 --- a/docs/en/docs/translations.md +++ b/docs/en/docs/translations.md @@ -16,7 +16,7 @@ PRs with suggestions to the language-specific LLM prompt require approval from a Let's say that you want to request translations for a language that is not yet translated, not even some pages. For example, Latin. -* The first step would be for you to find other 2 people that would be willing to be reviewing translation PRs for that language with you. +* The first step would be for you to find 2 other people who would be willing to be reviewing translation PRs for that language with you. * Once there are at least 3 people that would be willing to commit to help maintain that language, you can continue the next steps. * Create a new discussion following the template. * Tag the other 2 people that will help with the language, and ask them to confirm in the comments that they will help. diff --git a/docs/en/docs/tutorial/body.md b/docs/en/docs/tutorial/body.md index dda9798d8b..b074a751dd 100644 --- a/docs/en/docs/tutorial/body.md +++ b/docs/en/docs/tutorial/body.md @@ -10,7 +10,7 @@ To declare a **request** body, you use [Pydantic](https://docs.pydantic.dev/) mo /// note -To send data, you should use one of: `POST` (the more common), `PUT`, `DELETE` or `PATCH`. +To send data, you should use one of: `POST` (the most common), `PUT`, `DELETE` or `PATCH`. Sending a body with a `GET` request has an undefined behavior in the specifications, nevertheless, it is supported by FastAPI, only for very complex/extreme use cases. diff --git a/docs/en/docs/tutorial/metadata.md b/docs/en/docs/tutorial/metadata.md index 9cab5ca71b..4516d49b02 100644 --- a/docs/en/docs/tutorial/metadata.md +++ b/docs/en/docs/tutorial/metadata.md @@ -11,7 +11,7 @@ You can set the following fields that are used in the OpenAPI specification and | `title` | `str` | The title of the API. | | `summary` | `str` | A short summary of the API. Available since OpenAPI 3.1.0, FastAPI 0.99.0. | | `description` | `str` | A short description of the API. It can use Markdown. | -| `version` | `string` | The version of the API. This is the version of your own application, not of OpenAPI. For example `2.5.0`. | +| `version` | `str` | The version of the API. This is the version of your own application, not of OpenAPI. For example `2.5.0`. | | `terms_of_service` | `str` | A URL to the Terms of Service for the API. If provided, this has to be a URL. | | `contact` | `dict` | The contact information for the exposed API. It can contain several fields.
contact fields
ParameterTypeDescription
namestrThe identifying name of the contact person/organization.
urlstrThe URL pointing to the contact information. MUST be in the format of a URL.
emailstrThe email address of the contact person/organization. MUST be in the format of an email address.
| | `license_info` | `dict` | The license information for the exposed API. It can contain several fields.
license_info fields
ParameterTypeDescription
namestrREQUIRED (if a license_info is set). The license name used for the API.
identifierstrAn [SPDX](https://spdx.org/licenses/) license expression for the API. The identifier field is mutually exclusive of the url field. Available since OpenAPI 3.1.0, FastAPI 0.99.0.
urlstrA URL to the license used for the API. MUST be in the format of a URL.
| diff --git a/docs/en/docs/tutorial/response-status-code.md b/docs/en/docs/tutorial/response-status-code.md index a5f82ffb65..2dabc0617a 100644 --- a/docs/en/docs/tutorial/response-status-code.md +++ b/docs/en/docs/tutorial/response-status-code.md @@ -49,7 +49,7 @@ If you already know what HTTP status codes are, skip to the next section. In HTTP, you send a numeric status code of 3 digits as part of the response. -These status codes have a name associated to recognize them, but the important part is the number. +These status codes have an associated name to help recognize them, but the important part is the number. In short: diff --git a/docs/en/docs/tutorial/security/get-current-user.md b/docs/en/docs/tutorial/security/get-current-user.md index f8a5fdf821..59a90a7e17 100644 --- a/docs/en/docs/tutorial/security/get-current-user.md +++ b/docs/en/docs/tutorial/security/get-current-user.md @@ -14,7 +14,7 @@ First, let's create a Pydantic user model. The same way we use Pydantic to declare bodies, we can use it anywhere else: -{* ../../docs_src/security/tutorial002_an_py310.py hl[5,12:6] *} +{* ../../docs_src/security/tutorial002_an_py310.py hl[5,12:16] *} ## Create a `get_current_user` dependency { #create-a-get-current-user-dependency }