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
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