]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Fix small typos in the documentation (#12213)
authorSofie Van Landeghem <svlandeg@users.noreply.github.com>
Wed, 18 Sep 2024 16:09:57 +0000 (18:09 +0200)
committerGitHub <noreply@github.com>
Wed, 18 Sep 2024 16:09:57 +0000 (18:09 +0200)
14 files changed:
docs/en/docs/advanced/additional-responses.md
docs/en/docs/advanced/async-tests.md
docs/en/docs/advanced/behind-a-proxy.md
docs/en/docs/advanced/custom-response.md
docs/en/docs/advanced/middleware.md
docs/en/docs/advanced/path-operation-advanced-configuration.md
docs/en/docs/advanced/response-directly.md
docs/en/docs/advanced/security/http-basic-auth.md
docs/en/docs/advanced/security/oauth2-scopes.md
docs/en/docs/advanced/settings.md
docs/en/docs/deployment/concepts.md
docs/en/docs/deployment/docker.md
docs/en/docs/deployment/server-workers.md
docs/en/docs/release-notes.md

index 674f0672cb97c20d0f368b86a5fa8526de13c8e1..4fec412131c1545781bea0ada0df673daef2d08c 100644 (file)
@@ -18,7 +18,7 @@ But for those additional responses you have to make sure you return a `Response`
 
 You can pass to your *path operation decorators* a parameter `responses`.
 
-It receives a `dict`, the keys are status codes for each response, like `200`, and the values are other `dict`s with the information for each of them.
+It receives a `dict`: the keys are status codes for each response (like `200`), and the values are other `dict`s with the information for each of them.
 
 Each of those response `dict`s can have a key `model`, containing a Pydantic model, just like `response_model`.
 
index 580d9142c45743c67b593276fef914d19e88d68e..a528c80feb7289fac46e4a55c33acfa3438307d4 100644 (file)
@@ -102,6 +102,6 @@ As the testing function is now asynchronous, you can now also call (and `await`)
 
 /// tip
 
-If you encounter a `RuntimeError: Task attached to a different loop` when integrating asynchronous function calls in your tests (e.g. when using <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">MongoDB's MotorClient</a>) Remember to instantiate objects that need an event loop only within async functions, e.g. an `'@app.on_event("startup")` callback.
+If you encounter a `RuntimeError: Task attached to a different loop` when integrating asynchronous function calls in your tests (e.g. when using <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">MongoDB's MotorClient</a>), remember to instantiate objects that need an event loop only within async functions, e.g. an `'@app.on_event("startup")` callback.
 
 ///
index 5ff64016c256fd9656c2b835b15573c6a5095258..e642b191029f6f76795d613545532005356d518a 100644 (file)
@@ -303,7 +303,7 @@ This is a more advanced use case. Feel free to skip it.
 
 By default, **FastAPI** will create a `server` in the OpenAPI schema with the URL for the `root_path`.
 
-But you can also provide other alternative `servers`, for example if you want *the same* docs UI to interact with a staging and production environments.
+But you can also provide other alternative `servers`, for example if you want *the same* docs UI to interact with both a staging and a production environment.
 
 If you pass a custom list of `servers` and there's a `root_path` (because your API lives behind a proxy), **FastAPI** will insert a "server" with this `root_path` at the beginning of the list.
 
index 79f755815309de2fd73b8cc44ca87546bc39ddff..1cefe979f6ac18ba6d3ccfc4f01cd561839b6b79 100644 (file)
@@ -142,7 +142,7 @@ It accepts the following parameters:
 * `headers` - A `dict` of strings.
 * `media_type` - A `str` giving the media type. E.g. `"text/html"`.
 
-FastAPI (actually Starlette) will automatically include a Content-Length header. It will also include a Content-Type header, based on the media_type and appending a charset for text types.
+FastAPI (actually Starlette) will automatically include a Content-Length header. It will also include a Content-Type header, based on the `media_type` and appending a charset for text types.
 
 ```Python hl_lines="1  18"
 {!../../../docs_src/response_directly/tutorial002.py!}
@@ -154,7 +154,7 @@ Takes some text or bytes and returns an HTML response, as you read above.
 
 ### `PlainTextResponse`
 
-Takes some text or bytes and returns an plain text response.
+Takes some text or bytes and returns a plain text response.
 
 ```Python hl_lines="2  7  9"
 {!../../../docs_src/custom_response/tutorial005.py!}
@@ -273,7 +273,7 @@ Asynchronously streams a file as the response.
 
 Takes a different set of arguments to instantiate than the other response types:
 
-* `path` - The filepath to the file to stream.
+* `path` - The file path to the file to stream.
 * `headers` - Any custom headers to include, as a dictionary.
 * `media_type` - A string giving the media type. If unset, the filename or path will be used to infer a media type.
 * `filename` - If set, this will be included in the response `Content-Disposition`.
index 70415adca3a51d7e044a51ecafe776b00d1e3d42..ab7778db0716c2d4805c8719c70df2a10284fa40 100644 (file)
@@ -24,7 +24,7 @@ app = SomeASGIApp()
 new_app = UnicornMiddleware(app, some_config="rainbow")
 ```
 
-But FastAPI (actually Starlette) provides a simpler way to do it that makes sure that the internal middlewares to handle server errors and custom exception handlers work properly.
+But FastAPI (actually Starlette) provides a simpler way to do it that makes sure that the internal middlewares handle server errors and custom exception handlers work properly.
 
 For that, you use `app.add_middleware()` (as in the example for CORS).
 
@@ -55,7 +55,7 @@ For the next examples, you could also use `from starlette.middleware.something i
 
 Enforces that all incoming requests must either be `https` or `wss`.
 
-Any incoming requests to `http` or `ws` will be redirected to the secure scheme instead.
+Any incoming request to `http` or `ws` will be redirected to the secure scheme instead.
 
 ```Python hl_lines="2  6"
 {!../../../docs_src/advanced_middleware/tutorial001.py!}
index c8874bad9092d26682f2a2b8268d58ffe42efbe5..d599006d201874610150a2f4c40587481acddd61 100644 (file)
@@ -149,7 +149,7 @@ For example, you could decide to read and validate the request with your own cod
 
 You could do that with `openapi_extra`:
 
-```Python hl_lines="20-37  39-40"
+```Python hl_lines="19-36  39-40"
 {!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
 ```
 
index 2251659c55a92ae7a026d1ce76e8bbc57a8c9910..092aeceb142f59b846fe78e6934619693739fc99 100644 (file)
@@ -28,7 +28,7 @@ This gives you a lot of flexibility. You can return any data type, override any
 
 ## Using the `jsonable_encoder` in a `Response`
 
-Because **FastAPI** doesn't do any change to a `Response` you return, you have to make sure its contents are ready for it.
+Because **FastAPI** doesn't make any changes to a `Response` you return, you have to make sure its contents are ready for it.
 
 For example, you cannot put a Pydantic model in a `JSONResponse` without first converting it to a `dict` with all the data types (like `datetime`, `UUID`, etc) converted to JSON-compatible types.
 
index c302bf8dcbc9fe275a87ad74085a909aa1d1b780..e669d10d8ed0b9883bb0dddc24f2208545c57900 100644 (file)
@@ -144,7 +144,7 @@ And then they can try again knowing that it's probably something more similar to
 
 #### A "professional" attack
 
-Of course, the attackers would not try all this by hand, they would write a program to do it, possibly with thousands or millions of tests per second. And would get just one extra correct letter at a time.
+Of course, the attackers would not try all this by hand, they would write a program to do it, possibly with thousands or millions of tests per second. And they would get just one extra correct letter at a time.
 
 But doing that, in some minutes or hours the attackers would have guessed the correct username and password, with the "help" of our application, just using the time taken to answer.
 
index ff52d7bb80d0b8ab7c37713de070e8fd8126081f..fdd8db7b92d6149f0752d51a1abebe248ce61779 100644 (file)
@@ -769,7 +769,7 @@ But if you are building an OAuth2 application that others would connect to (i.e.
 
 The most common is the implicit flow.
 
-The most secure is the code flow, but is more complex to implement as it requires more steps. As it is more complex, many providers end up suggesting the implicit flow.
+The most secure is the code flow, but it's more complex to implement as it requires more steps. As it is more complex, many providers end up suggesting the implicit flow.
 
 /// note
 
index 22bf7de200e84965e35d3422ead90e486e84dc12..8c04d2507671e9a56a1d21d73aa2450b34068f90 100644 (file)
@@ -374,7 +374,7 @@ Prefer to use the `Annotated` version if possible.
 
 ////
 
-Then for any subsequent calls of `get_settings()` in the dependencies for the next requests, instead of executing the internal code of `get_settings()` and creating a new `Settings` object, it will return the same object that was returned on the first call, again and again.
+Then for any subsequent call of `get_settings()` in the dependencies for the next requests, instead of executing the internal code of `get_settings()` and creating a new `Settings` object, it will return the same object that was returned on the first call, again and again.
 
 #### `lru_cache` Technical Details
 
index 69ee71a7351bf9a6d3e3e9ab7b339ad468c1039b..e71a7487a6169159ff952b4f050af530d8161601 100644 (file)
@@ -257,7 +257,7 @@ But in most cases, you will want to perform these steps only **once**.
 
 So, you will want to have a **single process** to perform those **previous steps**, before starting the application.
 
-And you will have to make sure that it's a single process running those previous steps *even* if afterwards, you start **multiple processes** (multiple workers) for the application itself. If those steps were run by **multiple processes**, they would **duplicate** the work by running it on **parallel**, and if the steps were something delicate like a database migration, they could cause conflicts with each other.
+And you will have to make sure that it's a single process running those previous steps *even* if afterwards, you start **multiple processes** (multiple workers) for the application itself. If those steps were run by **multiple processes**, they would **duplicate** the work by running it in **parallel**, and if the steps were something delicate like a database migration, they could cause conflicts with each other.
 
 Of course, there are some cases where there's no problem in running the previous steps multiple times, in that case, it's a lot easier to handle.
 
index 2d832a238ceaf79313e620687a6f5765364c9f0b..b106f7ac33a5ba09b8736a1a94b048335b4f10b8 100644 (file)
@@ -615,6 +615,6 @@ Using container systems (e.g. with **Docker** and **Kubernetes**) it becomes fai
 * Memory
 * Previous steps before starting
 
-In most cases, you probably won't want to use any base image, and instead **build a container image from scratch** one based on the official Python Docker image.
+In most cases, you probably won't want to use any base image, and instead **build a container image from scratch** based on the official Python Docker image.
 
 Taking care of the **order** of instructions in the `Dockerfile` and the **Docker cache** you can **minimize build times**, to maximize your productivity (and avoid boredom). 😎
index 5e369e07175ba06a8f928ca1adb5b82591797b53..622c10a307f7b7670b43cf99a05115c94565fcf4 100644 (file)
@@ -139,7 +139,7 @@ From the list of deployment concepts from above, using workers would mainly help
 
 ## Containers and Docker
 
-In the next chapter about [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank} I'll tell some strategies you could use to handle the other **deployment concepts**.
+In the next chapter about [FastAPI in Containers - Docker](docker.md){.internal-link target=_blank} I'll explain some strategies you could use to handle the other **deployment concepts**.
 
 I'll show you how to **build your own image from scratch** to run a single Uvicorn process. It is a simple process and is probably what you would want to do when using a distributed container management system like **Kubernetes**.
 
index ea7ac92157460b1732f72b6f68e72611486fd0f6..5e8815e65ae4bfcad24c36d9fcc99884694971c1 100644 (file)
@@ -494,7 +494,7 @@ Discussed here: [#11522](https://github.com/fastapi/fastapi/pull/11522) and here
 ### Upgrades
 
 * ➖ Remove `orjson` and `ujson` from default dependencies. PR [#11842](https://github.com/tiangolo/fastapi/pull/11842) by [@tiangolo](https://github.com/tiangolo).
-    * These dependencies are still installed when you install with `pip install "fastapi[all]"`. But they not included in `pip install fastapi`.
+    * These dependencies are still installed when you install with `pip install "fastapi[all]"`. But they are not included in `pip install fastapi`.
 * 📝 Restored Swagger-UI links to use the latest version possible. PR [#11459](https://github.com/tiangolo/fastapi/pull/11459) by [@UltimateLobster](https://github.com/UltimateLobster).
 
 ### Docs