]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update includes in `docs/en/docs/how-to/extending-openapi.md` (#12562)
authorPhilip Okiokio <55271518+philipokiokio@users.noreply.github.com>
Sun, 27 Oct 2024 15:15:05 +0000 (16:15 +0100)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2024 15:15:05 +0000 (15:15 +0000)
docs/en/docs/how-to/extending-openapi.md

index 2b036795215c4c17f674cfc6723dda32e5bad2aa..8c77907255cd2d9a23119c4ef3770a77eaa47870 100644 (file)
@@ -43,25 +43,24 @@ For example, let's add <a href="https://github.com/Rebilly/ReDoc/blob/master/doc
 
 First, write all your **FastAPI** application as normally:
 
-```Python hl_lines="1  4  7-9"
-{!../../docs_src/extending_openapi/tutorial001.py!}
-```
+{* ../../docs_src/extending_openapi/tutorial001.py hl[1,4,7:9] *}
+
 
 ### Generate the OpenAPI schema
 
 Then, use the same utility function to generate the OpenAPI schema, inside a `custom_openapi()` function:
 
-```Python hl_lines="2  15-21"
-{!../../docs_src/extending_openapi/tutorial001.py!}
-```
+
+
+{* ../../docs_src/extending_openapi/tutorial001.py hl[2,15:21] *}
+
 
 ### Modify the OpenAPI schema
 
 Now you can add the ReDoc extension, adding a custom `x-logo` to the `info` "object" in the OpenAPI schema:
 
-```Python hl_lines="22-24"
-{!../../docs_src/extending_openapi/tutorial001.py!}
-```
+{* ../../docs_src/extending_openapi/tutorial001.py hl[22:24] *}
+
 
 ### Cache the OpenAPI schema
 
@@ -71,17 +70,18 @@ That way, your application won't have to generate the schema every time a user o
 
 It will be generated only once, and then the same cached schema will be used for the next requests.
 
-```Python hl_lines="13-14  25-26"
-{!../../docs_src/extending_openapi/tutorial001.py!}
-```
+
+{* ../../docs_src/extending_openapi/tutorial001.py hl[13:14,25:26] *}
+
 
 ### Override the method
 
 Now you can replace the `.openapi()` method with your new function.
 
-```Python hl_lines="29"
-{!../../docs_src/extending_openapi/tutorial001.py!}
-```
+
+
+{* ../../docs_src/extending_openapi/tutorial001.py hl[29] *}
+
 
 ### Check it