]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✏️ Fix grammar, typos, and broken links in docs (#15694)
authorYurii Motov <109919500+YuriiMotov@users.noreply.github.com>
Fri, 19 Jun 2026 09:29:44 +0000 (11:29 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Jun 2026 09:29:44 +0000 (09:29 +0000)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
70 files changed:
README.md
docs/en/docs/_llm-test.md
docs/en/docs/advanced/additional-status-codes.md
docs/en/docs/advanced/advanced-dependencies.md
docs/en/docs/advanced/dataclasses.md
docs/en/docs/advanced/events.md
docs/en/docs/advanced/generate-clients.md
docs/en/docs/advanced/json-base64-bytes.md
docs/en/docs/advanced/openapi-callbacks.md
docs/en/docs/advanced/response-change-status-code.md
docs/en/docs/advanced/response-cookies.md
docs/en/docs/advanced/response-headers.md
docs/en/docs/advanced/security/oauth2-scopes.md
docs/en/docs/advanced/settings.md
docs/en/docs/advanced/stream-data.md
docs/en/docs/advanced/wsgi.md
docs/en/docs/alternatives.md
docs/en/docs/async.md
docs/en/docs/deployment/cloud.md
docs/en/docs/deployment/concepts.md
docs/en/docs/deployment/docker.md
docs/en/docs/deployment/https.md
docs/en/docs/deployment/manually.md
docs/en/docs/editor-support.md
docs/en/docs/environment-variables.md
docs/en/docs/external-links.md
docs/en/docs/fastapi-people.md
docs/en/docs/features.md
docs/en/docs/help-fastapi.md
docs/en/docs/how-to/configure-swagger-ui.md
docs/en/docs/how-to/custom-request-and-route.md
docs/en/docs/how-to/graphql.md
docs/en/docs/how-to/migrate-from-pydantic-v1-to-pydantic-v2.md
docs/en/docs/how-to/separate-openapi-schemas.md
docs/en/docs/index.md
docs/en/docs/project-generation.md
docs/en/docs/python-types.md
docs/en/docs/reference/status.md
docs/en/docs/reference/websockets.md
docs/en/docs/release-notes.md
docs/en/docs/translations.md
docs/en/docs/tutorial/bigger-applications.md
docs/en/docs/tutorial/body-nested-models.md
docs/en/docs/tutorial/body.md
docs/en/docs/tutorial/debugging.md
docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
docs/en/docs/tutorial/extra-data-types.md
docs/en/docs/tutorial/extra-models.md
docs/en/docs/tutorial/first-steps.md
docs/en/docs/tutorial/handling-errors.md
docs/en/docs/tutorial/index.md
docs/en/docs/tutorial/metadata.md
docs/en/docs/tutorial/path-operation-configuration.md
docs/en/docs/tutorial/query-params-str-validations.md
docs/en/docs/tutorial/query-params.md
docs/en/docs/tutorial/request-files.md
docs/en/docs/tutorial/request-forms.md
docs/en/docs/tutorial/response-status-code.md
docs/en/docs/tutorial/schema-extra-example.md
docs/en/docs/tutorial/security/first-steps.md
docs/en/docs/tutorial/security/get-current-user.md
docs/en/docs/tutorial/security/oauth2-jwt.md
docs/en/docs/tutorial/security/simple-oauth2.md
docs/en/docs/tutorial/sql-databases.md
docs/en/docs/tutorial/static-files.md
docs/en/docs/tutorial/testing.md
docs/en/docs/virtual-environments.md
fastapi/.agents/skills/fastapi/SKILL.md
fastapi/.agents/skills/fastapi/references/dependencies.md
fastapi/.agents/skills/fastapi/references/other-tools.md

index 386aa430ea4d61d886ce963aebe4655836586faa..fbf66a48b877a18852697dfab6d7db74ec177a6f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -432,13 +432,13 @@ For a more complete example including more features, see the <a href="https://fa
 
 **Spoiler alert**: the tutorial - user guide includes:
 
-* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
-* How to set **validation constraints** as `maximum_length` or `regex`.
+* Declaration of **parameters** from other different places such as: **headers**, **cookies**, **form fields** and **files**.
+* How to set **validation constraints** such as `maximum_length` or `regex`.
 * A very powerful and easy to use **<dfn title="also known as components, resources, providers, services, injectables">Dependency Injection</dfn>** system.
 * Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
 * More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
 * **GraphQL** integration with [Strawberry](https://strawberry.rocks) and other libraries.
-* Many extra features (thanks to Starlette) as:
+* Many extra features (thanks to Starlette) such as:
     * **WebSockets**
     * extremely easy tests based on HTTPX and `pytest`
     * **CORS**
index 2b548064d3f019cabfba7120467119665a76f1d9..603474cfc652c8b1b7282f83f9486e0a8bf72c97 100644 (file)
@@ -185,7 +185,7 @@ See section `### Links` in the general prompt in `scripts/translate.py`.
 
 //// tab | Test
 
-Here some things wrapped in HTML "abbr" elements (Some are invented):
+Here are some things wrapped in HTML "abbr" elements (Some are invented):
 
 ### The abbr gives a full phrase { #the-abbr-gives-a-full-phrase }
 
@@ -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`.
 
index 3b6da2355718eb9ecebca33cbdc88d60bf626016..c4f1bf3896482da9b4d5f6e6ece67e4b9b1fb677 100644 (file)
@@ -8,7 +8,7 @@ It will use the default status code or the one you set in your *path operation*.
 
 If you want to return additional status codes apart from the main one, you can do that by returning a `Response` directly, like a `JSONResponse`, and set the additional status code directly.
 
-For example, let's say that you want to have a *path operation* that allows to update items, and returns HTTP status codes of 200 "OK" when successful.
+For example, let's say that you want to have a *path operation* that allows updating items, and returns HTTP status codes of 200 "OK" when successful.
 
 But you also want it to accept new items. And when the items didn't exist before, it creates them, and returns an HTTP status code of 201 "Created".
 
index 59ab62bf005f486608cbe6658238b920da471891..e039788aeded7f1d8df2e069671b5461d5e53264 100644 (file)
@@ -54,7 +54,7 @@ checker(q="somequery")
 
 /// tip
 
-All this might seem contrived. And it might not be very clear how is it useful yet.
+All this might seem contrived. And it might not be very clear how it is useful yet.
 
 These examples are intentionally simple, but show how it all works.
 
@@ -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 how it could look:
 
 {* ../../docs_src/dependencies/tutorial013_an_py310.py *}
 
index 292dc3fba94dc879ac7eb8108d2b306a9db9733b..fbabe0c872ad650887fd60117d251537be81b6a5 100644 (file)
@@ -24,7 +24,7 @@ Keep in mind that dataclasses can't do everything Pydantic models can do.
 
 So, you might still need to use Pydantic models.
 
-But if you have a bunch of dataclasses laying around, this is a nice trick to use them to power a web API using FastAPI. 🤓
+But if you have a bunch of dataclasses lying around, this is a nice trick to use them to power a web API using FastAPI. 🤓
 
 ///
 
index 3e65854e7b3461b767fcc60d95299a0cbc06f991..8f8cdb0176f4d768c909caebc0060725ef21ebab 100644 (file)
@@ -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.
 
index eb1c53ab7e26932d76f661e5336ab7b0b790b421..7db45cc8ae7bc1e87eff7f66bc7359e819b2bb75 100644 (file)
@@ -24,7 +24,7 @@ FastAPI automatically generates **OpenAPI 3.1** specifications, so any tool you
 
 This section highlights **venture-backed** and **company-supported** solutions from companies that sponsor FastAPI. These products provide **additional features** and **integrations** on top of high-quality generated SDKs.
 
-By ✨ [**sponsoring FastAPI**](../help-fastapi.md#sponsor-the-author) ✨, these companies help ensure the framework and its **ecosystem** remain healthy and **sustainable**.
+By ✨ [**sponsoring FastAPI**](https://github.com/sponsors/tiangolo) ✨, these companies help ensure the framework and its **ecosystem** remain healthy and **sustainable**.
 
 Their sponsorship also demonstrates a strong commitment to the FastAPI **community** (you), showing that they care not only about offering a **great service** but also about supporting a **robust and thriving framework**, FastAPI. 🙇
 
index 9f0602c54f18f68a767779938b32c2fe65c891f3..55f4a99b409d3e2da42970b830e630e684b1d117 100644 (file)
@@ -4,7 +4,7 @@ If your app needs to receive and send JSON data, but you need to include binary
 
 ## Base64 vs Files { #base64-vs-files }
 
-Consider first if you can use [Request Files](../tutorial/request-files.md) for uploading binary data and [Custom Response - FileResponse](./custom-response.md#fileresponse--fileresponse-) for sending binary data, instead of encoding it in JSON.
+Consider first if you can use [Request Files](../tutorial/request-files.md) for uploading binary data and [Custom Response - FileResponse](./custom-response.md#fileresponse) for sending binary data, instead of encoding it in JSON.
 
 JSON can only contain UTF-8 encoded strings, so it can't contain raw bytes.
 
index 81970911087eeed3044a2c557fbc495fec73553f..17910e1cfcb051bd77cf6b1f24fedcc523bd8c0f 100644 (file)
@@ -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 how that external API *should* look. 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 how the normal API app would look 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 how that *external API* should look 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* how that *external API* should look.
 
 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 how the *external API* should look... 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 how the *external API* should look:
 
 <img src="/img/tutorial/openapi-callbacks/image01.png">
index 8efd631981a079374cbbd27cca8ffbf268297d74..747016722c67ea6fc7c1da0fe3752bff8d07caa0 100644 (file)
@@ -18,7 +18,7 @@ For those cases, you can use a `Response` parameter.
 
 You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies and headers).
 
-And then you can set the `status_code` in that *temporal* response object.
+And then you can set the `status_code` in that *temporary* response object.
 
 {* ../../docs_src/response_change_status_code/tutorial001_py310.py hl[1,9,12] *}
 
@@ -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.
index a7ad90cad87cc82b68ffc125103676fb1e6ba6f5..f523a5c63cdafce24df0f1b5342c29a0f41a13bb 100644 (file)
@@ -4,7 +4,7 @@
 
 You can declare a parameter of type `Response` in your *path operation function*.
 
-And then you can set cookies in that *temporal* response object.
+And then you can set cookies in that *temporary* response object.
 
 {* ../../docs_src/response_cookies/tutorial002_py310.py hl[1, 8:9] *}
 
@@ -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.
 
index d7738635dc373f5f9afa7bab8023aab6c54ba160..cbc28e4959f897a53d79769debae954d85d2fb0d 100644 (file)
@@ -4,7 +4,7 @@
 
 You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies).
 
-And then you can set headers in that *temporal* response object.
+And then you can set headers in that *temporary* response object.
 
 {* ../../docs_src/response_headers/tutorial002_py310.py hl[1, 7:8] *}
 
@@ -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.
 
index 92b604757b35b8f83b42e86f0c06bb90888c7dd9..60e900d2cde7e14872960c7d2e17ef08d29cd6e2 100644 (file)
@@ -194,11 +194,11 @@ For this, we use `security_scopes.scopes`, that contains a `list` with all these
 
 Let's review again this dependency tree and the scopes.
 
-As the `get_current_active_user` dependency has as a sub-dependency on `get_current_user`, the scope `"me"` declared at `get_current_active_user` will be included in the list of required scopes in the `security_scopes.scopes` passed to `get_current_user`.
+As the `get_current_active_user` dependency has `get_current_user` as a sub-dependency, the scope `"me"` declared at `get_current_active_user` will be included in the list of required scopes in the `security_scopes.scopes` passed to `get_current_user`.
 
 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:
index f0f3bb41d0af566fa236ba3a0269bcc2355a2dcb..ff313f0881eb9f6721e9b4cb704c964b75ea9240 100644 (file)
@@ -14,7 +14,7 @@ To understand environment variables you can read [Environment Variables](../envi
 
 ## Types and validation { #types-and-validation }
 
-These environment variables can only handle text strings, as they are external to Python and have to be compatible with other programs and the rest of the system (and even with different operating systems, as Linux, Windows, macOS).
+These environment variables can only handle text strings, as they are external to Python and have to be compatible with other programs and the rest of the system (and even with different operating systems, such as Linux, Windows, and macOS).
 
 That means that any value read in Python from an environment variable will be a `str`, and any conversion to a different type or any validation has to be done in code.
 
index 3e7c89a9343c2a19d2655e8b36257c0571382443..40ea3374344d5fad5bd6b427b8b2187aefb5d8d8 100644 (file)
@@ -14,7 +14,7 @@ Added in FastAPI 0.134.0.
 
 You could use this if you want to stream pure strings, for example directly from the output of an **AI LLM** service.
 
-You could also use it to stream **large binary files**, where you stream each chunk of data as you read it, without having to read it all in memory at once.
+You could also use it to stream **large binary files**, where you stream each chunk of data as you read it, without having to read it all into memory at once.
 
 You could also stream **video** or **audio** this way, it could even be generated as you process and send it.
 
index 39a492eb6e723528cce508a5c6c110fa35e59d37..8dcc3c4010441dc240cc5582ee06d42af7874f17 100644 (file)
@@ -24,7 +24,7 @@ And then mount that under a path.
 
 Previously, it was recommended to use `WSGIMiddleware` from `fastapi.middleware.wsgi`, but it is now deprecated.
 
-Its advised to use the `a2wsgi` package instead. The usage remains the same.
+It's advised to use the `a2wsgi` package instead. The usage remains the same.
 
 Just ensure that you have the `a2wsgi` package installed and import `WSGIMiddleware` correctly from `a2wsgi`.
 
index 0e7dc85716ee067c1ca6442586337c7158e70d01..d4942a37bd0ac1b184a67f872d0ae6eaeb8d1ac4 100644 (file)
@@ -24,7 +24,7 @@ It was created to generate the HTML in the backend, not to create APIs used by a
 
 ### [Django REST Framework](https://www.django-rest-framework.org/) { #django-rest-framework }
 
-Django REST framework was created to be a flexible toolkit for building Web APIs using Django underneath, to improve its API capabilities.
+Django REST Framework was created to be a flexible toolkit for building Web APIs using Django underneath, to improve its API capabilities.
 
 It is used by many companies including Mozilla, Red Hat and Eventbrite.
 
@@ -345,7 +345,7 @@ Hug was created by Timothy Crosley, the same creator of [`isort`](https://github
 
 Hug inspired parts of APIStar, and was one of the tools I found most promising, alongside APIStar.
 
-Hug helped inspiring **FastAPI** to use Python type hints to declare parameters, and to generate a schema defining the API automatically.
+Hug helped inspire **FastAPI** to use Python type hints to declare parameters, and to generate a schema defining the API automatically.
 
 Hug inspired **FastAPI** to declare a `response` parameter in functions to set headers and cookies.
 
@@ -380,7 +380,7 @@ Now APIStar is a set of tools to validate OpenAPI specifications, not a web fram
 APIStar was created by Tom Christie. The same guy that created:
 
 * Django REST Framework
-* Starlette (in which **FastAPI** is based)
+* Starlette (on which **FastAPI** is based)
 * Uvicorn (used by Starlette and **FastAPI**)
 
 ///
@@ -393,7 +393,7 @@ The idea of declaring multiple things (data validation, serialization and docume
 
 And after searching for a long time for a similar framework and testing many different alternatives, APIStar was the best option available.
 
-Then APIStar stopped to exist as a server and Starlette was created, and was a new better foundation for such a system. That was the final inspiration to build **FastAPI**.
+Then APIStar stopped existing as a server and Starlette was created, and was a new better foundation for such a system. That was the final inspiration to build **FastAPI**.
 
 I consider **FastAPI** a "spiritual successor" to APIStar, while improving and increasing the features, typing system, and other parts, based on the learnings from all these previous tools.
 
index 1ad99603421be32051dc46248f27f6da025c5b09..d975ddb53997c012f1de95226f2a3934c595e527 100644 (file)
@@ -70,7 +70,7 @@ Asynchronous code just means that the language 💬 has a way to tell the comput
 
 So, during that time, the computer can go and do some other work, while "slow-file" 📝 finishes.
 
-Then the computer / program 🤖 will come back every time it has a chance because it's waiting again, or whenever it 🤖 finished all the work it had at that point. And it 🤖 will see if any of the tasks it was waiting for have already finished, doing whatever it had to do.
+Then the computer / program 🤖 will come back every time it has a chance because it's waiting again, or whenever it 🤖 finishes all the work it had at that point. And it 🤖 will see if any of the tasks it was waiting for have already finished, doing whatever it had to do.
 
 Next, it 🤖 takes the first task to finish (let's say, our "slow-file" 📝) and continues whatever it had to do with it.
 
@@ -78,7 +78,7 @@ That "wait for something else" normally refers to <abbr title="Input and Output"
 
 * the data from the client to be sent through the network
 * the data sent by your program to be received by the client through the network
-* the contents of a file in the disk to be read by the system and given to your program
+* the contents of a file on the disk to be read by the system and given to your program
 * the contents your program gave to the system to be written to disk
 * a remote API operation
 * a database operation to finish
@@ -257,7 +257,7 @@ And as you can have parallelism and asynchronicity at the same time, you get hig
 
 Nope! That's not the moral of the story.
 
-Concurrency is different than parallelism. And it is better on **specific** scenarios that involve a lot of waiting. Because of that, it generally is a lot better than parallelism for web application development. But not for everything.
+Concurrency is different than parallelism. And it is better in **specific** scenarios that involve a lot of waiting. Because of that, it generally is a lot better than parallelism for web application development. But not for everything.
 
 So, to balance that out, imagine the following short story:
 
@@ -267,7 +267,7 @@ So, to balance that out, imagine the following short story:
 
 ---
 
-There's no waiting 🕙 anywhere, just a lot of work to be done, on multiple places of the house.
+There's no waiting 🕙 anywhere, just a lot of work to be done, in multiple places of the house.
 
 You could have turns as in the burgers example, first the living room, then the kitchen, but as you are not waiting 🕙 for anything, just cleaning and cleaning, the turns wouldn't affect anything.
 
@@ -296,7 +296,7 @@ With **FastAPI** you can take advantage of concurrency that is very common for w
 
 But you can also exploit the benefits of parallelism and multiprocessing (having multiple processes running in parallel) for **CPU bound** workloads like those in Machine Learning systems.
 
-That, plus the simple fact that Python is the main language for **Data Science**, Machine Learning and especially Deep Learning, make FastAPI a very good match for Data Science / Machine Learning web APIs and applications (among many others).
+That, plus the simple fact that Python is the main language for **Data Science**, Machine Learning and especially Deep Learning, makes FastAPI a very good match for Data Science / Machine Learning web APIs and applications (among many others).
 
 To see how to achieve this parallelism in production see the section about [Deployment](deployment/index.md).
 
@@ -340,7 +340,7 @@ burgers = get_burgers(2)
 
 ---
 
-So, if you are using a library that tells you that you can call it with `await`, you need to create the *path operation functions* that uses it with `async def`, like in:
+So, if you are using a library that tells you that you can call it with `await`, you need to create the *path operation functions* that use it with `async def`, like in:
 
 ```Python hl_lines="2-3"
 @app.get('/burgers')
@@ -435,7 +435,7 @@ Any other utility function that you call directly can be created with normal `de
 
 This is in contrast to the functions that FastAPI calls for you: *path operation functions* and dependencies.
 
-If your utility function is a normal function with `def`, it will be called directly (as you write it in your code), not in a threadpool, if the function is created with `async def` then you should `await` for that function when you call it in your code.
+If your utility function is a normal function with `def`, it will be called directly (as you write it in your code), not in a threadpool, if the function is created with `async def` then you should `await` that function when you call it in your code.
 
 ---
 
index 64e948b07985312ebb8fe6a6c116846d1422d956..7bdef253e3ff3b214cb8e1556cb3ede7a2187253 100644 (file)
@@ -16,7 +16,7 @@ FastAPI Cloud is the primary sponsor and funding provider for the *FastAPI and f
 
 ## Cloud Providers - Sponsors { #cloud-providers-sponsors }
 
-Some other cloud providers ✨ [**sponsor FastAPI**](../help-fastapi.md#sponsor-the-author) ✨ too. 🙇
+Some other cloud providers ✨ [**sponsor FastAPI**](https://github.com/sponsors/tiangolo) ✨ too. 🙇
 
 You might also want to consider them to follow their guides and try their services:
 
index 138c433f9bd394d1bc7c08dcae3a6176e5ade38e..fc99c2247e17694f3dea7699f19460e35db6d805 100644 (file)
@@ -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
index b021ef1b6a9846a890ff2d0ed90e3db78fad5699..bdc0351d0302966a6d7d3626b0c54a332ae6e46f 100644 (file)
@@ -283,7 +283,7 @@ CMD ["fastapi", "run", "app/main.py", "--proxy-headers", "--port", "80"]
 
 #### Docker Cache { #docker-cache }
 
-There's an important trick in this `Dockerfile`, we first copy the **file with the dependencies alone**, not the rest of the code. Let me tell you why is that.
+There's an important trick in this `Dockerfile`, we first copy the **file with the dependencies alone**, not the rest of the code. Let me tell you why that is.
 
 ```Dockerfile
 COPY ./requirements.txt /code/requirements.txt
@@ -301,7 +301,7 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 The file with the package requirements **won't change frequently**. So, by copying only that file, Docker will be able to **use the cache** for that step.
 
-And then, Docker will be able to **use the cache for the next step** that downloads and install those dependencies. And here's where we **save a lot of time**. ✨ ...and avoid boredom waiting. 😪😆
+And then, Docker will be able to **use the cache for the next step** that downloads and installs those dependencies. And here's where we **save a lot of time**. ✨ ...and avoid boredom waiting. 😪😆
 
 Downloading and installing the package dependencies **could take minutes**, but using the **cache** would **take seconds** at most.
 
@@ -488,7 +488,7 @@ And normally this **load balancer** would be able to handle requests that go to
 
 In this type of scenario, you probably would want to have **a single (Uvicorn) process per container**, as you would already be handling replication at the cluster level.
 
-So, in this case, you **would not** want to have multiple workers in the container, for example with the `--workers` command line option. You would want to have just a **single Uvicorn process** per container (but probably multiple containers).
+So, in this case, you **would not** want to have multiple workers in the container, for example with the `--workers` command line option. You would want to have just a **single Uvicorn process** per container (but probably multiple containers).
 
 Having another process manager inside the container (as would be with multiple workers) would only add **unnecessary complexity** that you are most probably already taking care of with your cluster system.
 
@@ -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 }
 
@@ -544,7 +544,7 @@ If you run **a single process per container** you will have a more or less well-
 
 And then you can set those same memory limits and requirements in your configurations for your container management system (for example in **Kubernetes**). That way it will be able to **replicate the containers** in the **available machines** taking into account the amount of memory needed by them, and the amount available in the machines in the cluster.
 
-If your application is **simple**, this will probably **not be a problem**, and you might not need to specify hard memory limits. But if you are **using a lot of memory** (for example with **machine learning** models), you should check how much memory you are consuming and adjust the **number of containers** that runs in **each machine** (and maybe add more machines to your cluster).
+If your application is **simple**, this will probably **not be a problem**, and you might not need to specify hard memory limits. But if you are **using a lot of memory** (for example with **machine learning** models), you should check how much memory you are consuming and adjust the **number of containers** that run on **each machine** (and maybe add more machines to your cluster).
 
 If you run **multiple processes per container** you will have to make sure that the number of processes started doesn't **consume more memory** than what is available.
 
index a77678be92e906a2372841ae25a10c56bb09fe35..8280c1173dd492a753b68c1336d6f5bcc6be268e 100644 (file)
@@ -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 }
 
@@ -192,7 +192,7 @@ All this renewal process, while still serving the app, is one of the main reason
 
 ## Proxy Forwarded Headers { #proxy-forwarded-headers }
 
-When using a proxy to handle HTTPS, your **application server** (for example Uvicorn via FastAPI CLI) doesn't known anything about the HTTPS process, it communicates with plain HTTP with the **TLS Termination Proxy**.
+When using a proxy to handle HTTPS, your **application server** (for example Uvicorn via FastAPI CLI) doesn't know anything about the HTTPS process, it communicates with plain HTTP with the **TLS Termination Proxy**.
 
 This **proxy** would normally set some HTTP headers on the fly before transmitting the request to the **application server**, to let the application server know that the request is being **forwarded** by the proxy.
 
index 47af49ea6c4800f0a9bb6178024c1a41012e70cd..ed49aa00ac9b02927e3e3ff6eefb3bd89b04366a 100644 (file)
@@ -93,7 +93,7 @@ A similar process would apply to any other ASGI server program.
 
 By adding the `standard`, Uvicorn will install and use some recommended extra dependencies.
 
-That including `uvloop`, the high-performance drop-in replacement for `asyncio`, that provides the big concurrency performance boost.
+That includes `uvloop`, the high-performance drop-in replacement for `asyncio`, that provides the big concurrency performance boost.
 
 When you install FastAPI with something like `pip install "fastapi[standard]"` you already get `uvicorn[standard]` as well.
 
index 4f74cf1310b1efbe524b86ea7e9ec2f3caaf0b44..0936456ebe688880656869ddb911354643a9b276 100644 (file)
@@ -20,4 +20,4 @@ By default, the extension will automatically discover FastAPI applications in yo
 - **Deploy to FastAPI Cloud** - One-click deployment of your app to [FastAPI Cloud](https://fastapicloud.com/).
 - **Stream Application Logs** - Real-time log streaming from your FastAPI Cloud-deployed application with level filtering and text search.
 
-If you'd like to familiarize yourself with the extension's features, you can checkout the extension walkthrough by opening the Command Palette (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or on macOS: <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and selecting "Welcome: Open walkthrough..." and then choosing the "Get started with FastAPI" walkthrough.
+If you'd like to familiarize yourself with the extension's features, you can check out the extension walkthrough by opening the Command Palette (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or on macOS: <kbd>Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) and selecting "Welcome: Open walkthrough..." and then choosing the "Get started with FastAPI" walkthrough.
index 010e27c37e43417704d85e535ac9838ced3a7101..b123694318b82a3e470fa953f3d0339ce7215f35 100644 (file)
@@ -159,7 +159,7 @@ You can read more about it at [The Twelve-Factor App: Config](https://12factor.n
 
 ## Types and Validation { #types-and-validation }
 
-These environment variables can only handle **text strings**, as they are external to Python and have to be compatible with other programs and the rest of the system (and even with different operating systems, as Linux, Windows, macOS).
+These environment variables can only handle **text strings**, as they are external to Python and have to be compatible with other programs and the rest of the system (and even with different operating systems, such as Linux, Windows, and macOS).
 
 That means that **any value** read in Python from an environment variable **will be a `str`**, and any conversion to a different type or any validation has to be done in code.
 
index e1614e818f32df704fab612bb00ddb13697b47e6..d614c64eb62f8f2849bcedf8e16611b3c09be8cc 100644 (file)
@@ -7,7 +7,7 @@ include_yaml:
 
 **FastAPI** has a great community constantly growing.
 
-There are many posts, articles, tools, and projects, related to **FastAPI**.
+There are many posts, articles, tools, and projects related to **FastAPI**.
 
 You could easily use a search engine or video platform to find many resources related to FastAPI.
 
index f8e462821bfb95a0e08ca5a36a5420004a214930..4fc1b0b1d25457d662b550f9962557d1f436d4cb 100644 (file)
@@ -31,7 +31,7 @@ This is me:
 
 </div>
 
-I'm the creator of **FastAPI**. You can read more about that in [Help FastAPI - Get Help - Connect with the author](help-fastapi.md#connect-with-the-author).
+I'm the creator of **FastAPI**. You can read more about that in [Help FastAPI - Follow the author](help-fastapi.md#follow-the-author).
 
 ...But here I want to show you the community.
 
@@ -42,9 +42,8 @@ I'm the creator of **FastAPI**. You can read more about that in [Help FastAPI -
 These are the people that:
 
 * [Help others with questions in GitHub](help-fastapi.md#help-others-with-questions-in-github).
-* [Create Pull Requests](help-fastapi.md#create-a-pull-request).
-* Review Pull Requests, [especially important for translations](contributing.md#translations).
-* Help [manage the repository](management-tasks.md) (team members).
+* Create or review Pull Requests.
+* Help [manage the repository](https://tiangolo.com/open-source/management-tasks/) (team members).
 
 All these tasks help maintain the repository.
 
@@ -54,7 +53,7 @@ A round of applause to them. 👏 🙇
 
 This is the current list of team members. 😎
 
-They have different levels of involvement and permissions, they can perform [repository management tasks](./management-tasks.md) and together we  [manage the FastAPI repository](./management.md).
+They have different levels of involvement and permissions, they can perform [repository management tasks](https://tiangolo.com/open-source/management-tasks/) and together we [manage the FastAPI repository](./management.md).
 
 <div class="user-list user-list-center">
 
@@ -66,7 +65,7 @@ They have different levels of involvement and permissions, they can perform [rep
 
 </div>
 
-Although the team members have the permissions to perform privileged tasks, all the [help from others maintaining FastAPI](./help-fastapi.md#help-maintain-fastapi) is very much appreciated! 🙇‍♂️
+Although the team members have the permissions to perform privileged tasks, all the help from others maintaining FastAPI is very much appreciated! 🙇‍♂️
 
 ## FastAPI Experts
 
@@ -186,7 +185,7 @@ These are the users that have [helped others the most with questions in GitHub](
 
 Here are the **Top Contributors**. 👷
 
-These users have [created the most Pull Requests](help-fastapi.md#create-a-pull-request) that have been *merged*.
+These users have created the most Pull Requests that have been *merged*.
 
 They have contributed source code, documentation, etc. 📦
 
@@ -210,7 +209,7 @@ There are hundreds of other contributors, you can see them all in the [FastAPI G
 
 These users are the **Top Translation Reviewers**. 🕵️
 
-Translation reviewers have the [**power to approve translations**](contributing.md#translations) of the documentation. Without them, there wouldn't be documentation in several other languages.
+Translation reviewers have the **power to approve translations** of the documentation. Without them, there wouldn't be documentation in several other languages.
 
 <div class="user-list user-list-center">
 {% for user in (translation_reviewers.values() | list)[:50] %}
index a1a271d28833e204d6fc0d0f201ce41f2a3a31b4..b4cafd00a779d67c7d34f102c698033f8fe5baa9 100644 (file)
@@ -73,11 +73,11 @@ Pass the keys and values of the `second_user_data` dict directly as key-value ar
 
 ### Editor support { #editor-support }
 
-All the framework was designed to be easy and intuitive to use, all the decisions were tested on multiple editors even before starting development, to ensure the best development experience.
+The whole framework was designed to be easy and intuitive to use, all the decisions were tested on multiple editors even before starting development, to ensure the best development experience.
 
 In the Python developer surveys, it's clear [that one of the most used features is "autocompletion"](https://www.jetbrains.com/research/python-developers-survey-2017/#tools-and-features).
 
-The whole **FastAPI** framework is based to satisfy that. Autocompletion works everywhere.
+The whole **FastAPI** framework is designed to satisfy that. Autocompletion works everywhere.
 
 You will rarely need to come back to the docs.
 
@@ -147,7 +147,7 @@ FastAPI includes an extremely easy to use, but extremely powerful <dfn title='al
 
 ### Unlimited "plug-ins" { #unlimited-plug-ins }
 
-Or in other way, no need for them, import and use the code you need.
+Or, in other words, no need for them, import and use the code you need.
 
 Any integration is designed to be so simple to use (with dependencies) that you can create a "plug-in" for your application in 2 lines of code using the same structure and syntax used for your *path operations*.
 
@@ -179,7 +179,7 @@ With **FastAPI** you get all of **Starlette**'s features (as FastAPI is just Sta
 
 **FastAPI** is fully compatible with (and based on) [**Pydantic**](https://docs.pydantic.dev/). So, any additional Pydantic code you have, will also work.
 
-Including external libraries also based on Pydantic, as <abbr title="Object-Relational Mapper">ORM</abbr>s, <abbr title="Object-Document Mapper">ODM</abbr>s for databases.
+Including external libraries also based on Pydantic, such as <abbr title="Object-Relational Mapper">ORM</abbr>s and <abbr title="Object-Document Mapper">ODM</abbr>s for databases.
 
 This also means that in many cases you can pass the same object you get from a request **directly to the database**, as everything is validated automatically.
 
index 3fcd400e75b27593771e401073ee3a3e79cc3f4d..14bd056460c24a7f151721fd3a818cec399c9c7e 100644 (file)
@@ -26,7 +26,7 @@ You can follow **FastAPI** online in several places:
 
 You can "star" FastAPI in GitHub (clicking the star button at the top right): [https://github.com/fastapi/fastapi](https://github.com/fastapi/fastapi). ⭐️
 
-By adding a star, other users will be able to find it more easily and see that it has been already useful for others.
+By adding a star, other users will be able to find it more easily and see that it has already been useful for others.
 
 ## Watch the GitHub repository for releases { #watch-the-github-repository-for-releases }
 
index 7c3d9cb25a10248fe859020a5e5fffa965903d16..c7cacd97e135c38ef251ef1b13002a66a5b01a06 100644 (file)
@@ -67,4 +67,4 @@ presets: [
 
 These are **JavaScript** objects, not strings, so you can't pass them from Python code directly.
 
-If you need to use JavaScript-only configurations like those, you can use one of the methods above. Override all the Swagger UI *path operation* and manually write any JavaScript you need.
+If you need to use JavaScript-only configurations like those, you can use one of the methods above. Override the whole Swagger UI *path operation* and manually write any JavaScript you need.
index bce232017e5753dbdcd2b2ac605a86ca81084c93..2b353d9b46e1a693e476b2f5fb5653be081ae246 100644 (file)
@@ -94,7 +94,7 @@ All we need to do is handle the request inside a `try`/`except` block:
 
 {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[14,16] *}
 
-If an exception occurs, the`Request` instance will still be in scope, so we can read and make use of the request body when handling the error:
+If an exception occurs, the `Request` instance will still be in scope, so we can read and make use of the request body when handling the error:
 
 {* ../../docs_src/custom_request_and_route/tutorial002_an_py310.py hl[17:19] *}
 
index 2d93876f35ce290180b7ad1eee6c5833b9062ef0..de149a74a8a02c3ae0e9bca062b0510e99122140 100644 (file)
@@ -57,4 +57,4 @@ If you need GraphQL, I still would recommend you check out [Strawberry](https://
 
 You can learn more about **GraphQL** in the [official GraphQL documentation](https://graphql.org/).
 
-You can also read more about each those libraries described above in their links.
+You can also read more about each of those libraries described above in their links.
index 99d3835c38f5c90a54d7a24d1c95b5fb500dfaed..816cf54f543e45062e62eff3ad7b3fce780d586b 100644 (file)
@@ -8,6 +8,8 @@ FastAPI version 0.119.0 introduced partial support for Pydantic v1 from inside o
 
 FastAPI 0.126.0 dropped support for Pydantic v1, while still supporting `pydantic.v1` for a little while.
 
+FastAPI 0.128.0 dropped support for `pydantic.v1` as well, so the latest versions of FastAPI require Pydantic v2.
+
 /// warning
 
 The Pydantic team stopped support for Pydantic v1 for the latest versions of Python, starting with **Python 3.14**.
@@ -54,6 +56,16 @@ This means that you can install the latest version of Pydantic v2 and import and
 
 ### FastAPI support for Pydantic v1 in v2 { #fastapi-support-for-pydantic-v1-in-v2 }
 
+/// warning
+
+This FastAPI support for `pydantic.v1` models was added in **FastAPI 0.119.0** and removed in **FastAPI 0.128.0**. It was meant to be a temporary aid for the migration to Pydantic v2.
+
+In current versions of FastAPI, using a `pydantic.v1` model in your app will raise an error.
+
+The rest of this section describes the temporary support available only in those older versions.
+
+///
+
 Since FastAPI 0.119.0, there's also partial support for Pydantic v1 from inside of Pydantic v2, to facilitate the migration to v2.
 
 So, you could upgrade Pydantic to the latest version 2, and change the imports to use the `pydantic.v1` submodule, and in many cases it would just work.
@@ -88,7 +100,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
@@ -122,6 +134,12 @@ If you need to use some of the FastAPI-specific tools for parameters like `Body`
 
 ### Migrate in steps { #migrate-in-steps }
 
+/// warning
+
+The gradual migration using both Pydantic v1 and v2 models in the same app described below only works in **FastAPI 0.119.0 to 0.127.x**. It was removed in **FastAPI 0.128.0**, the latest versions require **Pydantic v2** models.
+
+///
+
 /// tip
 
 First try with `bump-pydantic`, if your tests pass and that works, then you're done in one command. ✨
@@ -130,6 +148,6 @@ First try with `bump-pydantic`, if your tests pass and that works, then you're d
 
 If `bump-pydantic` doesn't work for your use case, you can use the support for both Pydantic v1 and v2 models in the same app to do the migration to Pydantic v2 gradually.
 
-You could fist upgrade Pydantic to use the latest version 2, and change the imports to use `pydantic.v1` for all your models.
+You could first upgrade Pydantic to use the latest version 2, and change the imports to use `pydantic.v1` for all your models.
 
 Then, you can start migrating your models from Pydantic v1 to v2 in groups, in gradual steps. 🚶
index 4eb684dc90a64ad8f7a8e724698e1bb6a7177ef3..66755f8b7a02f407554f3a74b479acb67e28f289 100644 (file)
@@ -46,7 +46,7 @@ If you interact with the docs and check the response, even though the code didn'
 
 This means that it will **always have a value**, it's just that sometimes the value could be `None` (or `null` in JSON).
 
-That means that, clients using your API don't have to check if the value exists or not, they can **assume the field will always be there**, but just that in some cases it will have the default value of `None`.
+That means that clients using your API don't have to check if the value exists or not, they can **assume the field will always be there**, but just that in some cases it will have the default value of `None`.
 
 The way to describe this in OpenAPI, is to mark that field as **required**, because it will always be there.
 
index 5f76d664e40933f830ce865bf15e37fc4b376355..7baeaab2620ea370e56169547d0dfdb4d097e86f 100644 (file)
@@ -477,13 +477,13 @@ For a more complete example including more features, see the <a href="https://fa
 
 **Spoiler alert**: the tutorial - user guide includes:
 
-* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
-* How to set **validation constraints** as `maximum_length` or `regex`.
+* Declaration of **parameters** from other different places such as: **headers**, **cookies**, **form fields** and **files**.
+* How to set **validation constraints** such as `maximum_length` or `regex`.
 * A very powerful and easy to use **<dfn title="also known as components, resources, providers, services, injectables">Dependency Injection</dfn>** system.
 * Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
 * More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
 * **GraphQL** integration with [Strawberry](https://strawberry.rocks) and other libraries.
-* Many extra features (thanks to Starlette) as:
+* Many extra features (thanks to Starlette) such as:
     * **WebSockets**
     * extremely easy tests based on HTTPX and `pytest`
     * **CORS**
index aa579af5ef21dd375fc1b07dffcab812713ff1fa..ab6e87527b6d4aca9e80ee2be254c056c045e1f0 100644 (file)
@@ -1,8 +1,8 @@
 # Full Stack FastAPI Template { #full-stack-fastapi-template }
 
-Templates, while typically come with a specific setup, are designed to be flexible and customizable. This allows you to modify and adapt them to your project's requirements, making them an excellent starting point. 🏁
+Templates, while they typically come with a specific setup, are designed to be flexible and customizable. This allows you to modify and adapt them to your project's requirements, making them an excellent starting point. 🏁
 
-You can use this template to get started, as it includes a lot of the initial set up, security, database and some API endpoints already done for you.
+You can use this template to get started, as it includes a lot of the initial setup, security, database and some API endpoints already done for you.
 
 GitHub Repository: [Full Stack FastAPI Template](https://github.com/tiangolo/full-stack-fastapi-template)
 
index 976129117edd57d0d0eb9715ee168398ca8b32c1..c8d9bf41c9ee02763a57b42474b4cdca5a07bcda 100644 (file)
@@ -2,7 +2,7 @@
 
 Python has support for optional "type hints" (also called "type annotations").
 
-These **"type hints"** or annotations are a special syntax that allow declaring the <dfn title="for example: str, int, float, bool">type</dfn> of a variable.
+These **"type hints"** or annotations are a special syntax that allows declaring the <dfn title="for example: str, int, float, bool">type</dfn> of a variable.
 
 By declaring types for your variables, editors and tools can give you better support.
 
@@ -44,7 +44,7 @@ It's a very simple program.
 
 But now imagine that you were writing it from scratch.
 
-At some point you would have started the definition of the function, you had the parameters ready...
+At some point you start defining the function, and you have the parameters ready...
 
 But then you have to call "that method that converts the first letter to upper case".
 
@@ -80,7 +80,7 @@ Those are the "type hints":
 
 {* ../../docs_src/python_types/tutorial002_py310.py hl[1] *}
 
-That is not the same as declaring default values like would be with:
+That is not the same as declaring default values like it would be with:
 
 ```Python
     first_name="john", last_name="doe"
index 6e0e816d3371117929ab77ca348bc12271f93ef7..16af90e0fd06f251bd5281ad529c5086e1438001 100644 (file)
@@ -16,7 +16,7 @@ For example:
 * 403: `status.HTTP_403_FORBIDDEN`
 * etc.
 
-It can be convenient to quickly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to remember the integer status codes by memory.
+It can be convenient to quickly access HTTP (and WebSocket) status codes in your app, using autocompletion for the name without having to memorize the integer status codes.
 
 Read more about it in the [FastAPI docs about Response Status Code](https://fastapi.tiangolo.com/tutorial/response-status-code/).
 
index bd9f438be65fe2dda3917ac88359fddfb3c07bb1..b1158b3878bb73005a7b60d5d9e90f0414bbc01b 100644 (file)
@@ -50,7 +50,7 @@ When you want to define dependencies that should be compatible with both HTTP an
 
 Additional classes for handling WebSockets.
 
-Provided directly by Starlette, but you can import it from `fastapi`:
+Provided directly by Starlette, but you can import them from `fastapi`:
 
 ```python
 from fastapi.websockets import WebSocketDisconnect, WebSocketState
@@ -60,7 +60,7 @@ from fastapi.websockets import WebSocketDisconnect, WebSocketState
 
 When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it.
 
-You can import it directly form `fastapi`:
+You can import it directly from `fastapi`:
 
 ```python
 from fastapi import WebSocketDisconnect
index 47db4eb55ef7a0e1c91acbbb08e790649b088b1b..4303813c0df0966584fc516b874116f4d05c1f48 100644 (file)
@@ -68,7 +68,7 @@ Before this, `router.include_router(other_router)` would take each path operatio
 
 This would mean that in the end there was only one top level router, part of the app.
 
-The way it is structured here is that there are a few additional classes to handle intermediate metadata for router and route inclusion. That way the information of "router X includes Y and Y includes Z" is stored somewhere, without affecting (recreating / clonning) the final route.
+The way it is structured here is that there are a few additional classes to handle intermediate metadata for router and route inclusion. That way the information of "router X includes Y and Y includes Z" is stored somewhere, without affecting (recreating / cloning) the final route.
 
 #### Non Objectives
 
@@ -87,7 +87,7 @@ Additionally, any logic that iterated on `router.routes` to modify them would no
 #### Features
 
 * Adding routes (path operations) after a router is included now works, they are reflected as they are not copied.
-* Including `subrouter` in `mainrouter` can be done before adding routes (path operations) to `subrouter`, because now the the entire object is stored instead of copying the routes.
+* Including `subrouter` in `mainrouter` can be done before adding routes (path operations) to `subrouter`, because now the entire object is stored instead of copying the routes.
 * As routes are not copied, in some cases that might save some memory.
 
 #### Alpha Features
@@ -102,7 +102,7 @@ Still, for now, consider this very experimental and potentially changing and bre
 
 #### Future Features Enabled
 
-* Custom `APIRoute` subclasses (undocumented, but alraedy works as desccribed above)
+* Custom `APIRoute` subclasses (undocumented, but already works as described above)
 * Custom `APIRouter` subclasses (undocumented, but already works as described above)
 * Dependencies per router
 * Exception handlers per router
@@ -409,7 +409,7 @@ Still, for now, consider this very experimental and potentially changing and bre
 ### Features
 
 * ✨ Add support for streaming JSON Lines and binary data with `yield`. PR [#15022](https://github.com/fastapi/fastapi/pull/15022) by [@tiangolo](https://github.com/tiangolo).
-    * This also upgrades Starlette from `>=0.40.0` to `>=0.46.0`, as it's needed to properly unrwap and re-raise exceptions from exception groups.
+    * This also upgrades Starlette from `>=0.40.0` to `>=0.46.0`, as it's needed to properly unwrap and re-raise exceptions from exception groups.
     * New docs: [Stream JSON Lines](https://fastapi.tiangolo.com/tutorial/stream-json-lines/).
     * And new docs: [Stream Data](https://fastapi.tiangolo.com/advanced/stream-data/).
 
@@ -1432,7 +1432,7 @@ You can read more about it in the docs for [Advanced Dependencies - Dependencies
 * 🌐 Add Persian translation for `docs/fa/docs/python-types.md`. PR [#13524](https://github.com/fastapi/fastapi/pull/13524) by [@Mohammad222PR](https://github.com/Mohammad222PR).
 * 🌐 Update Portuguese Translation for `docs/pt/docs/project-generation.md`. PR [#13875](https://github.com/fastapi/fastapi/pull/13875) by [@EdmilsonRodrigues](https://github.com/EdmilsonRodrigues).
 * 🌐 Add Persian translation for `docs/fa/docs/async.md`. PR [#13541](https://github.com/fastapi/fastapi/pull/13541) by [@Mohammad222PR](https://github.com/Mohammad222PR).
-* 🌐 Add Bangali translation for `docs/bn/about/index.md`. PR [#13882](https://github.com/fastapi/fastapi/pull/13882) by [@sajjadrahman56](https://github.com/sajjadrahman56).
+* 🌐 Add Bengali translation for `docs/bn/about/index.md`. PR [#13882](https://github.com/fastapi/fastapi/pull/13882) by [@sajjadrahman56](https://github.com/sajjadrahman56).
 
 ### Internal
 
@@ -2274,7 +2274,7 @@ If you want to install `fastapi` with the standard dependencies but without `fas
 * ➕ Add docs dependency: markdown-include-variants. PR [#12399](https://github.com/fastapi/fastapi/pull/12399) by [@tiangolo](https://github.com/tiangolo).
 * 📝 Fix extra mdx-base-path paths. PR [#12397](https://github.com/fastapi/fastapi/pull/12397) by [@tiangolo](https://github.com/tiangolo).
 * 👷 Tweak labeler to not override custom labels. PR [#12398](https://github.com/fastapi/fastapi/pull/12398) by [@tiangolo](https://github.com/tiangolo).
-* 👷 Update worfkow deploy-docs-notify URL. PR [#12392](https://github.com/fastapi/fastapi/pull/12392) by [@tiangolo](https://github.com/tiangolo).
+* 👷 Update workflow deploy-docs-notify URL. PR [#12392](https://github.com/fastapi/fastapi/pull/12392) by [@tiangolo](https://github.com/tiangolo).
 * 👷 Update Cloudflare GitHub Action. PR [#12387](https://github.com/fastapi/fastapi/pull/12387) by [@tiangolo](https://github.com/tiangolo).
 * ⬆ Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.3. PR [#12386](https://github.com/fastapi/fastapi/pull/12386) by [@dependabot[bot]](https://github.com/apps/dependabot).
 * ⬆ Bump mkdocstrings[python] from 0.25.1 to 0.26.1. PR [#12371](https://github.com/fastapi/fastapi/pull/12371) by [@dependabot[bot]](https://github.com/apps/dependabot).
@@ -2790,7 +2790,7 @@ Discussed here: [#11522](https://github.com/fastapi/fastapi/pull/11522) and here
 * 📝 Update `security/first-steps.md`. PR [#11673](https://github.com/tiangolo/fastapi/pull/11673) by [@alejsdev](https://github.com/alejsdev).
 * 📝 Update note in `path-params-numeric-validations.md`. PR [#11672](https://github.com/tiangolo/fastapi/pull/11672) by [@alejsdev](https://github.com/alejsdev).
 * 📝 Tweak intro docs about `Annotated` and `Query()` params. PR [#11664](https://github.com/tiangolo/fastapi/pull/11664) by [@tiangolo](https://github.com/tiangolo).
-* 📝 Update JWT auth documentation to use PyJWT instead of pyhon-jose. PR [#11589](https://github.com/tiangolo/fastapi/pull/11589) by [@estebanx64](https://github.com/estebanx64).
+* 📝 Update JWT auth documentation to use PyJWT instead of python-jose. PR [#11589](https://github.com/tiangolo/fastapi/pull/11589) by [@estebanx64](https://github.com/estebanx64).
 * 📝 Update docs. PR [#11603](https://github.com/tiangolo/fastapi/pull/11603) by [@alejsdev](https://github.com/alejsdev).
 * ✏️ Fix typo: convert every 're-use' to 'reuse'.. PR [#11598](https://github.com/tiangolo/fastapi/pull/11598) by [@hasansezertasan](https://github.com/hasansezertasan).
 * ✏️ Fix typo in `fastapi/applications.py`. PR [#11593](https://github.com/tiangolo/fastapi/pull/11593) by [@petarmaric](https://github.com/petarmaric).
@@ -3229,7 +3229,7 @@ def my_dep():
 
 ### Security fixes
 
-* ⬆️ Upgrade minimum version of `python-multipart` to `>=0.0.7` to fix a vulnerability when using form data with a ReDos attack. You can also simply upgrade `python-multipart`.
+* ⬆️ Upgrade minimum version of `python-multipart` to `>=0.0.7` to fix a vulnerability when using form data with a ReDoS attack. You can also simply upgrade `python-multipart`.
 
 Read more in the [advisory: Content-Type Header ReDoS](https://github.com/tiangolo/fastapi/security/advisories/GHSA-qf9m-vfgh-m389).
 
@@ -4737,7 +4737,7 @@ You hopefully updated to a supported version of Python a while ago. If you haven
 ### Fixes
 
 * 🐛 Fix `RuntimeError` raised when `HTTPException` has a status code with no content. PR [#5365](https://github.com/tiangolo/fastapi/pull/5365) by [@iudeen](https://github.com/iudeen).
-* 🐛 Fix empty response body when default `status_code` is empty but the `Response` parameter with `response.status_code` is set. PR [#5360](https://github.com/tiangolo/fastapi/pull/5360) by [@tmeckel](https://github.com/tmeckel).
+* 🐛 Fix empty response body when default `status_code` is empty but the `Response` parameter with `response.status_code` is set. PR [#5360](https://github.com/tiangolo/fastapi/pull/5360) by [@tmeckel](https://github.com/tmeckel).
 
 ### Docs
 
@@ -5099,7 +5099,7 @@ def main(
 ### Internal
 
 * ♻ Refactor dict value extraction to minimize key lookups `fastapi/utils.py`. PR [#3139](https://github.com/tiangolo/fastapi/pull/3139) by [@ShahriyarR](https://github.com/ShahriyarR).
-* ✅ Add tests for required nonable parameters and body fields. PR [#4907](https://github.com/tiangolo/fastapi/pull/4907) by [@tiangolo](https://github.com/tiangolo).
+* ✅ Add tests for required `None`-able parameters and body fields. PR [#4907](https://github.com/tiangolo/fastapi/pull/4907) by [@tiangolo](https://github.com/tiangolo).
 * 👷 Fix installing Material for MkDocs Insiders in CI. PR [#4897](https://github.com/tiangolo/fastapi/pull/4897) by [@tiangolo](https://github.com/tiangolo).
 * 👷 Add pre-commit CI instead of custom GitHub Action. PR [#4896](https://github.com/tiangolo/fastapi/pull/4896) by [@tiangolo](https://github.com/tiangolo).
 * 👷 Add pre-commit GitHub Action workflow. PR [#4895](https://github.com/tiangolo/fastapi/pull/4895) by [@tiangolo](https://github.com/tiangolo).
@@ -5492,7 +5492,7 @@ Soon there will be a new FastAPI release upgrading Starlette to take advantage o
 
 ### Internal
 
-* ✨ Update GitHub Action: notify-translations, to avoid race conditions. PR [#3989](https://github.com/tiangolo/fastapi/pull/3989) by [@tiangolo](https://github.com/tiangolo).
+* ✨ Update GitHub Action: notify-translations, to avoid race conditions. PR [#3989](https://github.com/tiangolo/fastapi/pull/3989) by [@tiangolo](https://github.com/tiangolo).
 * ⬆️ Upgrade development `autoflake`, supporting multi-line imports. PR [#3988](https://github.com/tiangolo/fastapi/pull/3988) by [@tiangolo](https://github.com/tiangolo).
 * ⬆️ Increase dependency ranges for tests and docs: pytest-cov, pytest-asyncio, black, httpx, sqlalchemy, databases, mkdocs-markdownextradata-plugin. PR [#3987](https://github.com/tiangolo/fastapi/pull/3987) by [@tiangolo](https://github.com/tiangolo).
 * 👥 Update FastAPI People. PR [#3986](https://github.com/tiangolo/fastapi/pull/3986) by [@github-actions[bot]](https://github.com/apps/github-actions).
@@ -5880,7 +5880,7 @@ router = APIRouter(prefix="/users", dependencies=[Depends(some_dependency)])
 
 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.
+But `include_router` is still useful to, for example, add 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):
 
@@ -5942,7 +5942,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
 
 * ✏️  Fix typo in Tutorial - Path Parameters. PR [#2231](https://github.com/tiangolo/fastapi/pull/2231) by [@mariacamilagl](https://github.com/mariacamilagl).
 * ✏ Fix a stylistic error in docs. PR [#2206](https://github.com/tiangolo/fastapi/pull/2206) by [@ddobrinskiy](https://github.com/ddobrinskiy).
-* ✏ Fix capitalizaiton typo in docs. PR [#2204](https://github.com/tiangolo/fastapi/pull/2204) by [@imba-tjd](https://github.com/imba-tjd).
+* ✏ Fix capitalization typo in docs. PR [#2204](https://github.com/tiangolo/fastapi/pull/2204) by [@imba-tjd](https://github.com/imba-tjd).
 * ✏ Fix typo in docs. PR [#2179](https://github.com/tiangolo/fastapi/pull/2179) by [@ammarasmro](https://github.com/ammarasmro).
 * 📝 Update/fix links in docs to use HTTPS. PR [#2165](https://github.com/tiangolo/fastapi/pull/2165) by [@imba-tjd](https://github.com/imba-tjd).
 * ✏ Fix typos and add rewording in docs. PR [#2159](https://github.com/tiangolo/fastapi/pull/2159) by [@nukopy](https://github.com/nukopy).
@@ -6070,7 +6070,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
 * Fix typo in docs for query parameters. PR [#1832](https://github.com/tiangolo/fastapi/pull/1832) by [@ycd](https://github.com/ycd).
 * Add docs about [Async Tests](https://fastapi.tiangolo.com/advanced/async-tests/). PR [#1619](https://github.com/tiangolo/fastapi/pull/1619) by [@empicano](https://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.
+    * 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 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://github.com/tiangolo/fastapi/pull/1851) based on original PR [#1627](https://github.com/tiangolo/fastapi/pull/1627) by [@chrisngyn](https://github.com/chrisngyn), [@YKo20010](https://github.com/YKo20010), [@kx-chen](https://github.com/kx-chen).
 * Re-enable Gitter releases bot. PR [#1831](https://github.com/tiangolo/fastapi/pull/1831).
@@ -6220,7 +6220,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 Sebastn 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).
@@ -6235,7 +6235,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
 
 * Allow enums to allow them to have their own schemas in OpenAPI. To support [pydantic/pydantic#1432](https://github.com/pydantic/pydantic/pull/1432) in FastAPI. PR [#1461](https://github.com/tiangolo/fastapi/pull/1461).
 * Add links for funding through [GitHub sponsors](https://github.com/sponsors/tiangolo). PR [#1425](https://github.com/tiangolo/fastapi/pull/1425).
-* Update issue template for for questions. PR [#1344](https://github.com/tiangolo/fastapi/pull/1344) by [@retnikt](https://github.com/retnikt).
+* Update issue template for questions. PR [#1344](https://github.com/tiangolo/fastapi/pull/1344) by [@retnikt](https://github.com/retnikt).
 * Update warning about storing passwords in docs. PR [#1336](https://github.com/tiangolo/fastapi/pull/1336) by [@skorokithakis](https://github.com/skorokithakis).
 * Fix typo. PR [#1326](https://github.com/tiangolo/fastapi/pull/1326) by [@chenl](https://github.com/chenl).
 * Add translation to Portuguese for [Alternatives, Inspiration and Comparisons - Alternativas, Inspiração e Comparações](https://fastapi.tiangolo.com/pt/alternatives/). PR [#1325](https://github.com/tiangolo/fastapi/pull/1325) by [@Serrones](https://github.com/Serrones).
@@ -6626,7 +6626,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
         * When declaring a `response_model` it is used directly to generate the response content, from whatever was returned from the *path operation function*.
         * Before this, the return content was first passed through `jsonable_encoder` to ensure it was a "jsonable" object, like a `dict`, instead of an arbitrary object with attributes (like an ORM model). That's why you should make sure to update your Pydantic models for objects with attributes to use `orm_mode = True`.
         * If you don't have a `response_model`, the return object will still be passed through `jsonable_encoder` first.
-        * When a `response_model` is declared, the same `response_model` type declaration won't be used as is, it will be "cloned" to create an new one (a cloned Pydantic `Field` with all the submodels cloned as well).
+        * When a `response_model` is declared, the same `response_model` type declaration won't be used as is, it will be "cloned" to create a new one (a cloned Pydantic `Field` with all the submodels cloned as well).
         * This avoids/fixes a potential security issue: as the returned object is passed directly to Pydantic, if the returned object was a subclass of the `response_model` (e.g. you return a `UserInDB` that inherits from `User` but contains extra fields, like `hashed_password`, and `User` is used in the `response_model`), it would still pass the validation (because `UserInDB` is a subclass of `User`) and the object would be returned as-is, including the `hashed_password`. To fix this, the declared `response_model` is cloned, if it is a Pydantic model class (or contains Pydantic model classes in it, e.g. in a `List[Item]`), the Pydantic model class(es) will be a different one (the "cloned" one). So, an object that is a subclass won't simply pass the validation and returned as-is, because it is no longer a sub-class of the cloned `response_model`. Instead, a new Pydantic model object will be created with the contents of the returned object. So, it will be a new object (made with the data from the returned one), and will be filtered by the cloned `response_model`, containing only the declared fields as normally.
     * PR [#322](https://github.com/tiangolo/fastapi/pull/322).
 
@@ -6769,7 +6769,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 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.
index ee55318778bbcfc93a5acda8c45e3a3ef3a068ec..2f1067255e6900c14abf25d52280b237c1927ea9 100644 (file)
@@ -16,10 +16,10 @@ 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 there they will help.
+* Tag the other 2 people that will help with the language, and ask them to confirm in the comments that they will help.
 
 Once there are several people in the discussion, the FastAPI team can evaluate it and can make it an official translation.
 
index b1a6afb6a1e2a5e89ff77cc3a8562f5629addd16..b0e1a9b73898ab6e7e3ae55dda2f821b746f7759 100644 (file)
@@ -232,7 +232,7 @@ would mean:
 
 But that file doesn't exist, our dependencies are in a file at `app/dependencies.py`.
 
-Remember how our app/file structure looks like:
+Remember what our app/file structure looks like:
 
 <img src="/img/tutorial/bigger-applications/package.drawio.svg">
 
index 5479ab2a45930f1a79287f974654b3f7159aa133..61ed93202203fdc47f20cfde7308479c91aaf11a 100644 (file)
@@ -96,7 +96,7 @@ Again, doing just that declaration, with **FastAPI** you get:
 
 Apart from normal singular types like `str`, `int`, `float`, etc. you can use more complex singular types that inherit from `str`.
 
-To see all the options you have, checkout [Pydantic's Type Overview](https://docs.pydantic.dev/latest/concepts/types/). You will see some examples in the next chapter.
+To see all the options you have, check out [Pydantic's Type Overview](https://docs.pydantic.dev/latest/concepts/types/). You will see some examples in the next chapter.
 
 For example, as in the `Image` model we have a `url` field, we can declare it to be an instance of Pydantic's `HttpUrl` instead of a `str`:
 
index dda9798d8b74c9079aa61863bcee26bd51747bd1..b074a751dd778fc4eae1be8ec8c4cf30ade24608 100644 (file)
@@ -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.
 
index 8db47b9346c855a4845a99d13fb9276d83992f4a..5b57fe85b85bbf4de4e0dbd996abc1fa988c6bd9 100644 (file)
@@ -99,7 +99,7 @@ Here's how it might look:
 
 ---
 
-If you use Pycharm, you can:
+If you use PyCharm, you can:
 
 * Open the "Run" menu.
 * Select the option "Debug...".
index 658dee7c200b364e4bdab8febbae6d933bbc64d6..5574af5194e25b8c174308b6ddfa5b4cb760fa06 100644 (file)
@@ -234,6 +234,7 @@ participant operation as Path Operation
 Dependencies with `yield` have evolved over time to cover different use cases and fix some issues.
 
 If you want to see what has changed in different versions of FastAPI, you can read more about it in the advanced guide, in [Advanced Dependencies - Dependencies with `yield`, `HTTPException`, `except` and Background Tasks](../../advanced/advanced-dependencies.md#dependencies-with-yield-httpexception-except-and-background-tasks).
+
 ## Context Managers { #context-managers }
 
 ### What are "Context Managers" { #what-are-context-managers }
index 611aa9b9eeb40dc6d47a2d4c2a380a276e677e0b..63c914efe1ee767357518f1e96e4a25c882e425c 100644 (file)
@@ -36,7 +36,7 @@ Here are some of the additional data types you can use:
 * `datetime.timedelta`:
     * A Python `datetime.timedelta`.
     * In requests and responses will be represented as a `float` of total seconds.
-    * Pydantic also allows representing it as a "ISO 8601 time diff encoding", [see the docs for more info](https://docs.pydantic.dev/latest/concepts/serialization/#custom-serializers).
+    * Pydantic also allows representing it as an "ISO 8601 time diff encoding", [see the docs for more info](https://docs.pydantic.dev/latest/concepts/serialization/#custom-serializers).
 * `frozenset`:
     * In requests and responses, treated the same as a `set`:
         * In requests, a list will be read, eliminating duplicates and converting it to a `set`.
index e231aea90af738b08c75bdf2c6d565e08e6ffa48..d2b53cb66fbdb77e0c2f29f3084eba5679dc8e8d 100644 (file)
@@ -18,7 +18,7 @@ If you don't know, you will learn what a "password hash" is in the [security cha
 
 ## Multiple models { #multiple-models }
 
-Here's a general idea of how the models could look like with their password fields and the places where they are used:
+Here's a general idea of what the models could look like with their password fields and the places where they are used:
 
 {* ../../docs_src/extra_models/tutorial001_py310.py hl[7,9,14,20,22,27:28,31:33,38:39] *}
 
@@ -142,7 +142,7 @@ The supporting additional functions `fake_password_hasher` and `fake_save_user`
 
 Reducing code duplication is one of the core ideas in **FastAPI**.
 
-As code duplication increments the chances of bugs, security issues, code desynchronization issues (when you update in one place but not in the others), etc.
+As code duplication increases the chances of bugs, security issues, code desynchronization issues (when you update in one place but not in the others), etc.
 
 And these models are all sharing a lot of the data and duplicating attribute names and types.
 
@@ -208,4 +208,4 @@ In this case, you can use `dict`:
 
 Use multiple Pydantic models and inherit freely for each case.
 
-You don't need to have a single data model per entity if that entity must be able to have different "states". As the case with the user "entity" with a state including `password`, `password_hash` and no password.
+You don't need to have a single data model per entity if that entity must be able to have different "states". The **user** "entity" is an example, with states that include `password`, `password_hash`, or no password.
index f1a4b4702e2f8f8e6df7a2b1287f8acf65b65ec8..afef393417e9d4789226947d3e6c5ab77ebf9c35 100644 (file)
@@ -108,7 +108,7 @@ OpenAPI defines an API schema for your API. And that schema includes definitions
 
 #### Check the `openapi.json` { #check-the-openapi-json }
 
-If you are curious about how the raw OpenAPI schema looks like, FastAPI automatically generates a JSON (schema) with the descriptions of all your API.
+If you are curious about what the raw OpenAPI schema looks like, FastAPI automatically generates a JSON (schema) with the descriptions of all your API.
 
 You can see it directly at: [http://127.0.0.1:8000/openapi.json](http://127.0.0.1:8000/openapi.json).
 
index 78a5f1f20ae9b2b206353c7d173a6c4c2369f4fb..bb99813be91a213e84d1b29db8c8047dcba0e715 100644 (file)
@@ -1,6 +1,6 @@
 # Handling Errors { #handling-errors }
 
-There are many situations in which you need to notify an error to a client that is using your API.
+There are many situations in which you need to report an error to a client that is using your API.
 
 This client could be a browser with a frontend, a code from someone else, an IoT device, etc.
 
@@ -71,7 +71,7 @@ They are handled automatically by **FastAPI** and converted to JSON.
 
 ## Add custom headers { #add-custom-headers }
 
-There are some situations in where it's useful to be able to add custom headers to the HTTP error. For example, for some types of security.
+There are some situations where it's useful to be able to add custom headers to the HTTP error. For example, for some types of security.
 
 You probably won't need to use it directly in your code.
 
index 8a37756c703d81f7bf109519933aea19f8f4a7ea..9e73579199857819a5c02e32d8688487c712e55a 100644 (file)
@@ -92,7 +92,7 @@ FastAPI has an [official extension for VS Code](https://marketplace.visualstudio
 
 ## Advanced User Guide { #advanced-user-guide }
 
-There is also an **Advanced User Guide** that you can read later after this **Tutorial - User guide**.
+There is also an **Advanced User Guide** that you can read later after this **Tutorial - User Guide**.
 
 The **Advanced User Guide** builds on this one, uses the same concepts, and teaches you some extra features.
 
index 9cab5ca71bd6b94c9a253d056830f6b2aaebbdab..4516d49b02bd0a22b4137d0c125a345287398fd6 100644 (file)
@@ -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. <small>Available since OpenAPI 3.1.0, FastAPI 0.99.0.</small> |
 | `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. <details><summary><code>contact</code> fields</summary><table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>str</code></td><td>The identifying name of the contact person/organization.</td></tr><tr><td><code>url</code></td><td><code>str</code></td><td>The URL pointing to the contact information. MUST be in the format of a URL.</td></tr><tr><td><code>email</code></td><td><code>str</code></td><td>The email address of the contact person/organization. MUST be in the format of an email address.</td></tr></tbody></table></details> |
 | `license_info` | `dict` | The license information for the exposed API. It can contain several fields. <details><summary><code>license_info</code> fields</summary><table><thead><tr><th>Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><code>str</code></td><td><strong>REQUIRED</strong> (if a <code>license_info</code> is set). The license name used for the API.</td></tr><tr><td><code>identifier</code></td><td><code>str</code></td><td>An [SPDX](https://spdx.org/licenses/) license expression for the API. The <code>identifier</code> field is mutually exclusive of the <code>url</code> field. <small>Available since OpenAPI 3.1.0, FastAPI 0.99.0.</small></td></tr><tr><td><code>url</code></td><td><code>str</code></td><td>A URL to the license used for the API. MUST be in the format of a URL.</td></tr></tbody></table></details> |
index 8dfc6e2ffc490edbf00dc934acd44e51159b8ab5..9ba32ec97dee6fdf254a741d1ee0b4dc8d782c4d 100644 (file)
@@ -98,7 +98,7 @@ It will be clearly marked as deprecated in the interactive docs:
 
 <img src="/img/tutorial/path-operation-configuration/image04.png">
 
-Check how deprecated and non-deprecated *path operations* look like:
+Check how deprecated and non-deprecated *path operations* look:
 
 <img src="/img/tutorial/path-operation-configuration/image05.png">
 
index 0714d8beb19ce97e983bfa6963b6c7e76b06be81..eb9fa2607b824f5bb2a949af6fc55ad745e6af19 100644 (file)
@@ -406,7 +406,7 @@ But if you're curious about this specific code example and you're still entertai
 
 #### String with `value.startswith()` { #string-with-value-startswith }
 
-Did you notice? a string using `value.startswith()` can take a tuple, and it will check each value in the tuple:
+Did you notice? A string using `value.startswith()` can take a tuple, and it will check each value in the tuple:
 
 {* ../../docs_src/query_params_str_validations/tutorial015_an_py310.py ln[16:19] hl[17] *}
 
index 563d39f7d4752322ef8c467b03c43227e680d64c..cb89e23e7aeaf4c0ea97d743e6ab3015476faba5 100644 (file)
@@ -21,7 +21,7 @@ As they are part of the URL, they are "naturally" strings.
 
 But when you declare them with Python types (in the example above, as `int`), they are converted to that type and validated against it.
 
-All the same process that applied for path parameters also applies for query parameters:
+All the same processes that apply to path parameters also apply to query parameters:
 
 * Editor support (obviously)
 * Data <dfn title="converting the string that comes from an HTTP request into Python data">"parsing"</dfn>
index fe4290449bc5e0b752d8536e71ffed4873ee0b77..df789478114a14874955fb208199d7144d0ed6c8 100644 (file)
@@ -60,7 +60,7 @@ Using `UploadFile` has several advantages over `bytes`:
 
 * You don't have to use `File()` in the default value of the parameter.
 * It uses a "spooled" file:
-    * A file stored in memory up to a maximum size limit, and after passing this limit it will be stored in disk.
+    * A file stored in memory up to a maximum size limit, and after passing this limit it will be stored on disk.
 * This means that it will work well for large files like images, videos, large binaries, etc. without consuming all the memory.
 * You can get metadata from the uploaded file.
 * It has a [file-like](https://docs.python.org/3/glossary.html#term-file-like-object) `async` interface.
@@ -111,7 +111,7 @@ When you use the `async` methods, **FastAPI** runs the file methods in a threadp
 
 ## What is "Form Data" { #what-is-form-data }
 
-The way HTML forms (`<form></form>`) sends the data to the server normally uses a "special" encoding for that data, it's different from JSON.
+The way HTML forms (`<form></form>`) send the data to the server normally uses a "special" encoding for that data, it's different from JSON.
 
 **FastAPI** will make sure to read that data from the right place instead of JSON.
 
index 64e90a244224d55a0c53df871f52270bd8c0bdfd..45af663c8fb7f40dc417c86c6a554136800904a5 100644 (file)
@@ -46,7 +46,7 @@ To declare form bodies, you need to use `Form` explicitly, because without it th
 
 ## About "Form Fields" { #about-form-fields }
 
-The way HTML forms (`<form></form>`) sends the data to the server normally uses a "special" encoding for that data, it's different from JSON.
+The way HTML forms (`<form></form>`) send the data to the server normally uses a "special" encoding for that data, it's different from JSON.
 
 **FastAPI** will make sure to read that data from the right place instead of JSON.
 
index a5f82ffb6501ba1ce560b77044f7427239d303ce..2dabc0617a88f45fda4db4645a1ab626f89160d4 100644 (file)
@@ -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:
 
index 67c7ac37c2654cd4cb75a4854df47e45ed166895..280162531dba1dcedbb6fa81a5dc3dff50e680f3 100644 (file)
@@ -78,7 +78,7 @@ Nevertheless, at the <dfn title="2023-08-26">time of writing this</dfn>, Swagger
 
 ### OpenAPI-specific `examples` { #openapi-specific-examples }
 
-Since before **JSON Schema** supported `examples` OpenAPI had support for a different field also called `examples`.
+Since before **JSON Schema** supported `examples`, OpenAPI had support for a different field also called `examples`.
 
 This **OpenAPI-specific** `examples` goes in another section in the OpenAPI specification. It goes in the **details for each *path operation***, not inside each JSON Schema.
 
index 095b8b9017fe01c2e3eda010ba4c668f50921d29..7dae3edf40a24a252d32b20410b74e0fa31f4994 100644 (file)
@@ -88,7 +88,7 @@ And it can also be used by yourself, to debug, check and test the same applicati
 
 ## The `password` flow { #the-password-flow }
 
-Now let's go back a bit and understand what is all that.
+Now let's go back a bit and understand what all that is.
 
 The `password` "flow" is one of the ways ("flows") defined in OAuth2, to handle security and authentication.
 
index f8a5fdf821398ad81c517937e4d5a03a2777f6a3..59a90a7e175e4189c47b1ca9a35937c62aa7be1b 100644 (file)
@@ -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 }
 
index 6c1ab27b279bde4c065ea4d8705d6249dce30c24..68bad4e100f5ef57ad3c0938167a9f8368175683 100644 (file)
@@ -124,7 +124,7 @@ This ensures the endpoint takes roughly the same amount of time to respond wheth
 
 /// note
 
-If you check the new (fake) database `fake_users_db`, you will see how the hashed password looks like now: `"$argon2id$v=19$m=65536,t=3,p=4$wagCPXjifgvUFBzq4hqe3w$CYaIb8sB+wtD+Vu/P4uod1+Qof8h+1g7bbDlBID48Rc"`.
+If you check the new (fake) database `fake_users_db`, you will see what the hashed password looks like now: `"$argon2id$v=19$m=65536,t=3,p=4$wagCPXjifgvUFBzq4hqe3w$CYaIb8sB+wtD+Vu/P4uod1+Qof8h+1g7bbDlBID48Rc"`.
 
 ///
 
index afe3ba128f3271d4126f7cced152ef9ccecc00be..72e08b19a8bc7d2c75f90668e677c754134efed2 100644 (file)
@@ -6,7 +6,7 @@ Now let's build from the previous chapter and add the missing parts to have a co
 
 We are going to use **FastAPI** security utilities to get the `username` and `password`.
 
-OAuth2 specifies that when using the "password flow" (that we are using) the client/user must send `username` and `password` fields as form data.
+OAuth2 specifies that when using the "password flow" (that we are using) the client/user must send `username` and `password` fields as form data.
 
 And the spec says that the fields have to be named like that. So `user-name` or `email` wouldn't work.
 
@@ -146,7 +146,7 @@ UserInDB(
 
 /// note
 
-For a more complete explanation of `**user_dict` check back in [the documentation for **Extra Models**](../extra-models.md#about-user-in-dict).
+For a more complete explanation of `**user_dict` check back in [the documentation for **Extra Models**](../extra-models.md#about-user-in-model-dump).
 
 ///
 
@@ -190,7 +190,7 @@ We want to get the `current_user` *only* if this user is active.
 
 So, we create an additional dependency `get_current_active_user` that in turn uses `get_current_user` as a dependency.
 
-Both of these dependencies will just return an HTTP error if the user doesn't exist, or if is inactive.
+Both of these dependencies will just return an HTTP error if the user doesn't exist, or is inactive.
 
 So, in our endpoint, we will only get a user if the user exists, was correctly authenticated, and is active:
 
index b8cbac295bc741298822dacfc942a590ab66fb9f..1f4b12ca98ff708b5c2ec32143240e66c939d9fa 100644 (file)
@@ -201,7 +201,7 @@ Then let's create `Hero`, the actual *table model*, with the **extra fields** th
 * `id`
 * `secret_name`
 
-Because `Hero` inherits form `HeroBase`, it **also** has the **fields** declared in `HeroBase`, so all the fields for `Hero` are:
+Because `Hero` inherits from `HeroBase`, it **also** has the **fields** declared in `HeroBase`, so all the fields for `Hero` are:
 
 * `id`
 * `name`
index 38c2ef2485e3706a9ddb7ea52686140e9abfcb08..0b73a35c1f9ee3a1199dc61761d074f3e36c88a9 100644 (file)
@@ -33,7 +33,7 @@ The `directory="static"` refers to the name of the directory that contains your
 
 The `name="static"` gives it a name that can be used internally by **FastAPI**.
 
-All these parameters can be different than "`static`", adjust them with the needs and specific details of your own application.
+All these parameters can be different than "`static`", adjust them to the needs and specific details of your own application.
 
 ## More info { #more-info }
 
index 72f849f4bfd4c3b51d82cca75e0ca945ff35e66d..38976dc31536fa5aea52f2d36e7bc3cce778da5f 100644 (file)
@@ -24,7 +24,7 @@ Import `TestClient`.
 
 Create a `TestClient` by passing your **FastAPI** application to it.
 
-Create functions with a name that starts with `test_` (this is standard `pytest` conventions).
+Create functions with a name that starts with `test_` (this is a standard `pytest` convention).
 
 Use the `TestClient` object the same way as you do with `httpx`.
 
index 119a6926a3644ecf77de81996dffc94e8274212c..7f95cad248e3eb1f0654e2067893dca3943b00e1 100644 (file)
@@ -100,7 +100,7 @@ $ uv venv
 
 By default, `uv` will create a virtual environment in a directory called `.venv`.
 
-But you could customize it passing an additional argument with the directory name.
+But you could customize it by passing an additional argument with the directory name.
 
 ///
 
@@ -258,7 +258,7 @@ $ python -m ensurepip --upgrade
 
 </div>
 
-This command will install pip if it is not already installed and also ensures that the installed version of pip is at least as recent as the one available in `ensurepip`.
+This command will install pip if it is not already installed and also ensure that the installed version of pip is at least as recent as the one available in `ensurepip`.
 
 ///
 
@@ -447,7 +447,7 @@ Now you're ready to start working on your project.
 
 /// tip
 
-Do you want to understand what's all that above?
+Do you want to understand what all that above is?
 
 Continue reading. 👇🤓
 
@@ -548,7 +548,7 @@ Also, depending on your operating system (e.g. Linux, Windows, macOS), it could
 
 ## Where are Packages Installed { #where-are-packages-installed }
 
-When you install Python, it creates some directories with some files in your computer.
+When you install Python, it creates some directories with some files on your computer.
 
 Some of these directories are the ones in charge of having all the packages you install.
 
@@ -568,7 +568,7 @@ That will download a compressed file with the FastAPI code, normally from [PyPI]
 
 It will also **download** files for other packages that FastAPI depends on.
 
-Then it will **extract** all those files and put them in a directory in your computer.
+Then it will **extract** all those files and put them in a directory on your computer.
 
 By default, it will put those files downloaded and extracted in the directory that comes with your Python installation, that's the **global environment**.
 
@@ -846,7 +846,7 @@ This is a simple guide to get you started and teach you how everything works **u
 
 There are many **alternatives** to managing virtual environments, package dependencies (requirements), projects.
 
-Once you are ready and want to use a tool to **manage the entire project**, packages dependencies, virtual environments, etc. I would suggest you try [uv](https://github.com/astral-sh/uv).
+Once you are ready and want to use a tool to **manage the entire project**, package dependencies, virtual environments, etc. I would suggest you try [uv](https://github.com/astral-sh/uv).
 
 `uv` can do a lot of things, it can:
 
index 48cfdabb87941fdce350f3d84b8e51f08b51eab9..d5f32fa3c471314906128c2cafac69b1c9fcc828 100644 (file)
@@ -298,7 +298,7 @@ Apply shared dependencies at the router level via `dependencies=[Depends(...)]`.
 
 ## Async vs Sync *path operations*
 
-Use `async` *path operations* only when fully certain that the logic called inside is compatible with async and await (it's called with `await`) or that doesn't block.
+Use `async` *path operations* only when fully certain that the logic called inside is compatible with async and await (it's called with `await`) or that it doesn't block.
 
 ```python
 from fastapi import FastAPI
index ca709096e62aa1051a51695519cbb9f45b75646f..a562dd9469851c085b4591ce748ca6689864a1d3 100644 (file)
@@ -5,7 +5,7 @@ Use dependencies when:
 * They can't be declared in Pydantic validation and require additional logic
 * The logic depends on external resources or could block in any other way
 * Other dependencies need their results (it's a sub-dependency)
-* The logic can be shared by multiple endpoints to do things like error early, authentication, etc.
+* The logic can be shared by multiple endpoints to do things like error early, handle authentication, etc.
 * They need to handle cleanup (e.g., DB sessions, file handles), using dependencies with `yield`
 * Their logic needs input data from the request, like headers, query parameters, etc.
 
@@ -53,7 +53,7 @@ def get_username():
     try:
         yield "Rick"
     finally:
-        print("Cleanup up before response is sent")
+        print("Clean up before response is sent")
 
 UserNameDep = Annotated[str, Depends(get_username, scope="function")]
 
index 58b19d09669f8a548cf90ed8598af311ac3029d4..b5b58cfd62e330e738b25399175f9e5c921cd09d 100644 (file)
@@ -71,6 +71,6 @@ Prefer it over SQLAlchemy.
 
 ## HTTPX
 
-Use HTTPX for handling HTTP communication (e.g. with other APIs). It support sync and async usage.
+Use HTTPX for handling HTTP communication (e.g. with other APIs). It supports sync and async usage.
 
 Prefer it over Requests.