]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🎨 Fix syntax highlighting in docs for OpenAPI Callbacks (#4368)
authorJoon Hwan 김준환 <xncbf12@gmail.com>
Fri, 26 Aug 2022 13:04:48 +0000 (22:04 +0900)
committerGitHub <noreply@github.com>
Fri, 26 Aug 2022 13:04:48 +0000 (15:04 +0200)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/en/docs/advanced/openapi-callbacks.md

index 138c90dd7c43598e7ce9ee75dfda74a46709b2e8..656ddbb3f5abe0142156343fbac0038a86050d53 100644 (file)
@@ -31,7 +31,7 @@ It will have a *path operation* that will receive an `Invoice` body, and a query
 
 This part is pretty normal, most of the code is probably already familiar to you:
 
-```Python hl_lines="10-14  37-54"
+```Python hl_lines="9-13  36-53"
 {!../../../docs_src/openapi_callbacks/tutorial001.py!}
 ```
 
@@ -83,7 +83,7 @@ So we are going to use that same knowledge to document how the *external API* sh
 
 First create a new `APIRouter` that will contain one or more callbacks.
 
-```Python hl_lines="5  26"
+```Python hl_lines="3  25"
 {!../../../docs_src/openapi_callbacks/tutorial001.py!}
 ```
 
@@ -96,7 +96,7 @@ It should look just like a normal FastAPI *path operation*:
 * It should probably have a declaration of the body it should receive, e.g. `body: InvoiceEvent`.
 * And it could also have a declaration of the response it should return, e.g. `response_model=InvoiceEventReceived`.
 
-```Python hl_lines="17-19  22-23  29-33"
+```Python hl_lines="16-18  21-22  28-32"
 {!../../../docs_src/openapi_callbacks/tutorial001.py!}
 ```
 
@@ -163,7 +163,7 @@ At this point you have the *callback path operation(s)* needed (the one(s) that
 
 Now use the parameter `callbacks` in *your API's path operation decorator* to pass the attribute `.routes` (that's actually just a `list` of routes/*path operations*) from that callback router:
 
-```Python hl_lines="36"
+```Python hl_lines="35"
 {!../../../docs_src/openapi_callbacks/tutorial001.py!}
 ```