]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
:pencil2: Fix typos and docs notes
authorSebastián Ramírez <tiangolo@gmail.com>
Sat, 29 Dec 2018 14:43:58 +0000 (18:43 +0400)
committerSebastián Ramírez <tiangolo@gmail.com>
Sat, 29 Dec 2018 14:43:58 +0000 (18:43 +0400)
12 files changed:
docs/tutorial/body-multiple-params.md
docs/tutorial/body-schema.md
docs/tutorial/body.md
docs/tutorial/cookie-params.md
docs/tutorial/custom-response.md
docs/tutorial/dependencies/classes-as-dependencies.md
docs/tutorial/header-params.md
docs/tutorial/query-params-str-validations.md
docs/tutorial/query-params.md
docs/tutorial/request-files.md
docs/tutorial/request-forms.md
docs/tutorial/response-model.md

index 0884d1f90a0efe9eac44959ed13657d766446294..23ad4fad5765319e422e956b4b9d697dd5277662 100644 (file)
@@ -33,7 +33,7 @@ But you can also declare multiple body parameters, e.g. `item` and `user`:
 {!./src/body_multiple_params/tutorial002.py!}
 ```
 
-In this case, **FastAPI** will notice that there are more than one body parameter in the function (two parameters that are Pydantic models).
+In this case, **FastAPI** will notice that there are more than one body parameters in the function (two parameters that are Pydantic models).
 
 So, it will then use the parameter names as keys (field names) in the body, and expect a body like:
 
index 718181193307c32286cb1977a2416ab72d2b41dd..902de529750f15e27e8560d59960e4e1561e3df0 100644 (file)
@@ -9,7 +9,7 @@ First, you have to import it:
 ```
 
 !!! warning
-    Notice that `Schema` is imported directly from `pydantic`, not form `fastapi` as are all the rest (`Query`, `Path`, `Body`, etc).
+    Notice that `Schema` is imported directly from `pydantic`, not from `fastapi` as are all the rest (`Query`, `Path`, `Body`, etc).
 
 
 ## Declare model attributes
@@ -37,7 +37,7 @@ In `Schema`, `Path`, `Query`, `Body` and others you'll see later, you can declar
 
 Those parameters will be added as-is to the output JSON Schema.
 
-If you know JSON Schema and want to add extra information appart from what we have discussed here, you can pass that as extra keyword arguments.
+If you know JSON Schema and want to add extra information apart from what we have discussed here, you can pass that as extra keyword arguments.
 
 !!! warning
     Have in mind that extra parameters passed won't add any validation, only annotation, for documentation purposes.
index 98b1bfd454b3e06e2e58b50667eaaf9a0dfdbfd1..d59700748c07f47349b600d8001a2e1e1f67ca6e 100644 (file)
@@ -86,7 +86,7 @@ And will be also used in the API docs inside each path operation that needs them
 
 ## Editor support
 
-In your editor, inside your function you will get type hints and completion everywhere (this wouldn't happen if your received a `dict` instead of a Pydantic model):
+In your editor, inside your function you will get type hints and completion everywhere (this wouldn't happen if you received a `dict` instead of a Pydantic model):
 
 <img src="/img/tutorial/body/image03.png">
 
index e774e590f587096f66a721645306947a01b2cbb3..1fb5b16c23394ee27bbaa518e15f70f935a83618 100644 (file)
@@ -1,4 +1,4 @@
-You can define Cookie parameters the same way you define `Query` and `Path` parameteres.
+You can define Cookie parameters the same way you define `Query` and `Path` parameters.
 
 ## Import `Cookie`
 
@@ -8,11 +8,11 @@ First import `Cookie`:
 {!./src/cookie_params/tutorial001.py!}
 ```
 
-## Declare `Cookie` parameteres
+## Declare `Cookie` parameters
 
 Then declare the cookie parameters using the same structure as with `Path` and `Query`.
 
-The first value is the default value, you can pass all the extra validation or annotation parameteres:
+The first value is the default value, you can pass all the extra validation or annotation parameters:
 
 ```Python hl_lines="7"
 {!./src/cookie_params/tutorial001.py!}
@@ -22,7 +22,7 @@ The first value is the default value, you can pass all the extra validation or a
     `Cookie` is a "sister" class of `Path` and `Query`. It also inherits from the same common `Param` class.
 
 !!! info
-    To declare cookies, you need to use `Cookie`, because otherwise the parameters would be interpreted as query parameteres.
+    To declare cookies, you need to use `Cookie`, because otherwise the parameters would be interpreted as query parameters.
 
 ## Recap
 
index 85cf8ef28333933822e25ec7089cd8cb7ad35a22..0f076399227a1aab49828cfe009c91372a123e1a 100644 (file)
@@ -63,7 +63,7 @@ Pass `HTMLResponse` as the parameter `content_type` of your path operation:
     And it will be documented as such in OpenAPI.
 
 
-### return a Starlette `Response`
+### Return a Starlette `Response`
 
 You can also override the response directly in your path operation.
 
index a6c9cf057b38b219905af0a74025fe5e3e5c9235..e5ce515280e401f3438e4e0d79e4136ff61d004e 100644 (file)
@@ -50,7 +50,7 @@ What FastAPI actually checks is that it is a "callable" (function, class or anyt
 
 If you pass a "callable" as a dependency in **FastAPI**, it will analyze the parameters for that "callable", and process them in the same way as the parameters for a path operation function. Including sub-dependencies.
 
-That also applies to callables with no parameters at all. The same as would be for path operation functions with no parameteres.
+That also applies to callables with no parameters at all. The same as would be for path operation functions with no parameters.
 
 Then, we can change the dependency "dependable" `common_parameters` from above to the class `CommonQueryParameters`:
 
index cc62632655bb3616dd36570e6514bcca37e5cb0d..82684669f468dc98c274f387c2ca7ec50d2974aa 100644 (file)
@@ -1,4 +1,4 @@
-You can define Header parameters the same way you define `Query`, `Path` and `Cookie` parameteres.
+You can define Header parameters the same way you define `Query`, `Path` and `Cookie` parameters.
 
 ## Import `Header`
 
@@ -8,11 +8,11 @@ First import `Header`:
 {!./src/header_params/tutorial001.py!}
 ```
 
-## Declare `Header` parameteres
+## Declare `Header` parameters
 
 Then declare the header parameters using the same structure as with `Path`, `Query` and `Cookie`.
 
-The first value is the default value, you can pass all the extra validation or annotation parameteres:
+The first value is the default value, you can pass all the extra validation or annotation parameters:
 
 ```Python hl_lines="7"
 {!./src/header_params/tutorial001.py!}
@@ -22,7 +22,7 @@ The first value is the default value, you can pass all the extra validation or a
     `Header` is a "sister" class of `Path`, `Query` and `Cookie`. It also inherits from the same common `Param` class.
 
 !!! info
-    To declare headers, you need to use `Header`, because otherwise the parameters would be interpreted as query parameteres.
+    To declare headers, you need to use `Header`, because otherwise the parameters would be interpreted as query parameters.
 
 ## Automatic conversion
 
@@ -49,6 +49,6 @@ If for some reason you need to disable automatic conversion of underscores to hy
 
 ## Recap
 
-Declare headeres with `Header`, using the same common pattern as `Query`, `Path` and `Cookie`.
+Declare headers with `Header`, using the same common pattern as `Query`, `Path` and `Cookie`.
 
 And don't worry about underscores in your variables, **FastAPI** will take care of converting them.
index e25b414c92f1eb22f915101a03d679e3b3bbe75e..a44099aeaa60c6087f5f6441ac2181bd885dd42d 100644 (file)
@@ -130,6 +130,11 @@ You can add more information about the parameter.
 
 That information will be included in the generated OpenAPI and used by the documentation user interfaces and external tools.
 
+!!! note
+    Have in mind that different tools might have different levels of OpenAPI support.
+
+    Some of them might not show all the extra information declared yet, although in most of the cases, the missing feature is already planned for development.
+
 You can add a `title`:
 
 ```Python hl_lines="7"
index 153956df9c6cfa8af92f14c654d9b928a60bc72f..c499f45084abd69cf5e7570cd05eccf080799837 100644 (file)
@@ -129,7 +129,7 @@ When you declare a default value for non-path parameters (for now, we have only
 
 If you don't want to add a specific value but just make it optional, set the default as `None`.
 
-But when you want to make a query parameter required, you can just do not declare any default value:
+But when you want to make a query parameter required, you can just not declare any default value:
 
 ```Python hl_lines="6 7"
 {!./src/query_params/tutorial005.py!}
index eacf1862d6c6c27d056f2dfd799a24d450c48d98..835468ca4c8ec309c9204d9051d198b0fee67cbc 100644 (file)
@@ -22,7 +22,7 @@ The files will be uploaded as form data and you will receive the contents as `by
     `File` is a class that inherits directly from `Form`.
 
 !!! info
-    To declare File bodies, you need to use `File`, because otherwise the parameters would be interpreted as query parameteres or body (JSON) parameters.
+    To declare File bodies, you need to use `File`, because otherwise the parameters would be interpreted as query parameters or body (JSON) parameters.
 
 ## "Form Data"? 
 
index 2ee5d84aea8501ef4b64b07604d291a6151909f7..1f0d9d5d360e623ed79f88d166980d7c6c161e6b 100644 (file)
@@ -26,7 +26,7 @@ With `Form` you can declare the same metadata and validation as with `Body` (and
     `Form` is a class that inherits directly from `Body`.
 
 !!! info
-    To declare form bodies, you need to use `Form` explicitly, because without it the parameters would be interpreted as query parameteres or body (JSON) parameters.
+    To declare form bodies, you need to use `Form` explicitly, because without it the parameters would be interpreted as query parameters or body (JSON) parameters.
 
 ## "Form Fields"? 
 
index cae00caf059702bc7cc9e310c61dc3d4d16a7a7e..2dce3a863ba2af4bf56043ce75fd02fcdc5a4893 100644 (file)
@@ -42,7 +42,7 @@ Now, whenever a browser is creating a user with a password, the API will return
 
 In this case, it might not be a problem, becase the user himself is sending the password.
 
-But if we use sthe same model for another path operation, we could be sending the passwords of our users to every client.
+But if we use the same model for another path operation, we could be sending the passwords of our users to every client.
 
 !!! danger
     Never send the plain password of a user in a response.