Browse Source

Remove code examples for Python 3.8 in `metadata`

pull/14510/head
Yurii Motov 7 months ago
parent
commit
13925f2439
  1. 12
      docs/en/docs/tutorial/metadata.md
  2. 0
      docs_src/metadata/tutorial001_1_py39.py
  3. 0
      docs_src/metadata/tutorial001_py39.py
  4. 0
      docs_src/metadata/tutorial002_py39.py
  5. 0
      docs_src/metadata/tutorial003_py39.py
  6. 0
      docs_src/metadata/tutorial004_py39.py
  7. 2
      tests/test_tutorial/test_metadata/test_tutorial001.py
  8. 2
      tests/test_tutorial/test_metadata/test_tutorial001_1.py
  9. 2
      tests/test_tutorial/test_metadata/test_tutorial004.py

12
docs/en/docs/tutorial/metadata.md

@ -18,7 +18,7 @@ You can set the following fields that are used in the OpenAPI specification and
You can set them as follows:
{* ../../docs_src/metadata/tutorial001.py hl[3:16, 19:32] *}
{* ../../docs_src/metadata/tutorial001_py39.py hl[3:16, 19:32] *}
/// tip
@ -36,7 +36,7 @@ Since OpenAPI 3.1.0 and FastAPI 0.99.0, you can also set the `license_info` with
For example:
{* ../../docs_src/metadata/tutorial001_1.py hl[31] *}
{* ../../docs_src/metadata/tutorial001_1_py39.py hl[31] *}
## Metadata for tags { #metadata-for-tags }
@ -58,7 +58,7 @@ Let's try that in an example with tags for `users` and `items`.
Create metadata for your tags and pass it to the `openapi_tags` parameter:
{* ../../docs_src/metadata/tutorial004.py hl[3:16,18] *}
{* ../../docs_src/metadata/tutorial004_py39.py hl[3:16,18] *}
Notice that you can use Markdown inside of the descriptions, for example "login" will be shown in bold (**login**) and "fancy" will be shown in italics (_fancy_).
@ -72,7 +72,7 @@ You don't have to add metadata for all the tags that you use.
Use the `tags` parameter with your *path operations* (and `APIRouter`s) to assign them to different tags:
{* ../../docs_src/metadata/tutorial004.py hl[21,26] *}
{* ../../docs_src/metadata/tutorial004_py39.py hl[21,26] *}
/// info
@ -100,7 +100,7 @@ But you can configure it with the parameter `openapi_url`.
For example, to set it to be served at `/api/v1/openapi.json`:
{* ../../docs_src/metadata/tutorial002.py hl[3] *}
{* ../../docs_src/metadata/tutorial002_py39.py hl[3] *}
If you want to disable the OpenAPI schema completely you can set `openapi_url=None`, that will also disable the documentation user interfaces that use it.
@ -117,4 +117,4 @@ You can configure the two documentation user interfaces included:
For example, to set Swagger UI to be served at `/documentation` and disable ReDoc:
{* ../../docs_src/metadata/tutorial003.py hl[3] *}
{* ../../docs_src/metadata/tutorial003_py39.py hl[3] *}

0
docs_src/metadata/tutorial001_1.py → docs_src/metadata/tutorial001_1_py39.py

0
docs_src/metadata/tutorial001.py → docs_src/metadata/tutorial001_py39.py

0
docs_src/metadata/tutorial002.py → docs_src/metadata/tutorial002_py39.py

0
docs_src/metadata/tutorial003.py → docs_src/metadata/tutorial003_py39.py

0
docs_src/metadata/tutorial004.py → docs_src/metadata/tutorial004_py39.py

2
tests/test_tutorial/test_metadata/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from docs_src.metadata.tutorial001 import app
from docs_src.metadata.tutorial001_py39 import app
client = TestClient(app)

2
tests/test_tutorial/test_metadata/test_tutorial001_1.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from docs_src.metadata.tutorial001_1 import app
from docs_src.metadata.tutorial001_1_py39 import app
client = TestClient(app)

2
tests/test_tutorial/test_metadata/test_tutorial004.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from docs_src.metadata.tutorial004 import app
from docs_src.metadata.tutorial004_py39 import app
client = TestClient(app)

Loading…
Cancel
Save