mirror of https://github.com/tiangolo/fastapi.git
📝 Update includes for `docs/en/docs/how-to/configure-swagger-ui.md` (#12556)
This commit is contained in:
parent
d93e431505
commit
162a32cc2f
|
|
@ -18,9 +18,7 @@ Without changing the settings, syntax highlighting is enabled by default:
|
||||||
|
|
||||||
But you can disable it by setting `syntaxHighlight` to `False`:
|
But you can disable it by setting `syntaxHighlight` to `False`:
|
||||||
|
|
||||||
```Python hl_lines="3"
|
{* ../../docs_src/configure_swagger_ui/tutorial001.py hl[3] *}
|
||||||
{!../../docs_src/configure_swagger_ui/tutorial001.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
...and then Swagger UI won't show the syntax highlighting anymore:
|
...and then Swagger UI won't show the syntax highlighting anymore:
|
||||||
|
|
||||||
|
|
@ -30,9 +28,7 @@ But you can disable it by setting `syntaxHighlight` to `False`:
|
||||||
|
|
||||||
The same way you could set the syntax highlighting theme with the key `"syntaxHighlight.theme"` (notice that it has a dot in the middle):
|
The same way you could set the syntax highlighting theme with the key `"syntaxHighlight.theme"` (notice that it has a dot in the middle):
|
||||||
|
|
||||||
```Python hl_lines="3"
|
{* ../../docs_src/configure_swagger_ui/tutorial002.py hl[3] *}
|
||||||
{!../../docs_src/configure_swagger_ui/tutorial002.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
That configuration would change the syntax highlighting color theme:
|
That configuration would change the syntax highlighting color theme:
|
||||||
|
|
||||||
|
|
@ -44,17 +40,13 @@ FastAPI includes some default configuration parameters appropriate for most of t
|
||||||
|
|
||||||
It includes these default configurations:
|
It includes these default configurations:
|
||||||
|
|
||||||
```Python
|
{* ../../fastapi/openapi/docs.py ln[8:23] hl[17:23] *}
|
||||||
{!../../fastapi/openapi/docs.py[ln:7-23]!}
|
|
||||||
```
|
|
||||||
|
|
||||||
You can override any of them by setting a different value in the argument `swagger_ui_parameters`.
|
You can override any of them by setting a different value in the argument `swagger_ui_parameters`.
|
||||||
|
|
||||||
For example, to disable `deepLinking` you could pass these settings to `swagger_ui_parameters`:
|
For example, to disable `deepLinking` you could pass these settings to `swagger_ui_parameters`:
|
||||||
|
|
||||||
```Python hl_lines="3"
|
{* ../../docs_src/configure_swagger_ui/tutorial003.py hl[3] *}
|
||||||
{!../../docs_src/configure_swagger_ui/tutorial003.py!}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Other Swagger UI Parameters
|
## Other Swagger UI Parameters
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue