mirror of https://github.com/tiangolo/fastapi.git
59 lines
2.0 KiB
Markdown
59 lines
2.0 KiB
Markdown
# 🎲 🗄
|
||
|
||
🚥 👆 💪, 👆 💪 ⚙️ ⚒ & 🌐 🔢 🔗 🗄 ✔ ⚓️ 🔛 🌐, & ❎ ⚫️ 🍕.
|
||
|
||
## 🔃 💂♂, 🔗, & 🩺
|
||
|
||
🕵♂ 👆 🧾 👩💻 🔢 🏭 *🚫🔜 🚫* 🌌 🛡 👆 🛠️.
|
||
|
||
👈 🚫 🚮 🙆 ➕ 💂♂ 👆 🛠️, *➡ 🛠️* 🔜 💪 🌐❔ 👫.
|
||
|
||
🚥 📤 💂♂ ⚠ 👆 📟, ⚫️ 🔜 🔀.
|
||
|
||
🕵♂ 🧾 ⚒ ⚫️ 🌅 ⚠ 🤔 ❔ 🔗 ⏮️ 👆 🛠️, & 💪 ⚒ ⚫️ 🌅 ⚠ 👆 ℹ ⚫️ 🏭. ⚫️ 💪 🤔 🎯 📨 <a href="https://en.wikipedia.org/wiki/Security_through_obscurity" class="external-link" target="_blank">💂♂ 🔘 🌌</a>.
|
||
|
||
🚥 👆 💚 🔐 👆 🛠️, 📤 📚 👍 👜 👆 💪, 🖼:
|
||
|
||
* ⚒ 💭 👆 ✔️ 👍 🔬 Pydantic 🏷 👆 📨 💪 & 📨.
|
||
* 🔗 🙆 ✔ ✔ & 🔑 ⚙️ 🔗.
|
||
* 🙅 🏪 🔢 🔐, 🕴 🔐#️⃣.
|
||
* 🛠️ & ⚙️ 👍-💭 🔐 🧰, 💖 🇸🇲 & 🥙 🤝, ♒️.
|
||
* 🚮 🌅 🧽 ✔ 🎛 ⏮️ Oauth2️⃣ ↔ 🌐❔ 💪.
|
||
* ...♒️.
|
||
|
||
👐, 👆 5️⃣📆 ✔️ 📶 🎯 ⚙️ 💼 🌐❔ 👆 🤙 💪 ❎ 🛠️ 🩺 🌐 (✅ 🏭) ⚖️ ⚓️ 🔛 📳 ⚪️➡️ 🌐 🔢.
|
||
|
||
## 🎲 🗄 ⚪️➡️ ⚒ & 🇨🇻 {
|
||
|
||
👆 💪 💪 ⚙️ 🎏 Pydantic ⚒ 🔗 👆 🏗 🗄 & 🩺 ⚜.
|
||
|
||
🖼:
|
||
|
||
```Python hl_lines="6 11"
|
||
{!../../../docs_src/conditional_openapi/tutorial001.py!}
|
||
```
|
||
|
||
📥 👥 📣 ⚒ `openapi_url` ⏮️ 🎏 🔢 `"/openapi.json"`.
|
||
|
||
& ⤴️ 👥 ⚙️ ⚫️ 🕐❔ 🏗 `FastAPI` 📱.
|
||
|
||
⤴️ 👆 💪 ❎ 🗄 (✅ 🎚 🩺) ⚒ 🌐 🔢 `OPENAPI_URL` 🛁 🎻, 💖:
|
||
|
||
<div class="termy">
|
||
|
||
```console
|
||
$ OPENAPI_URL= uvicorn main:app
|
||
|
||
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
|
||
```
|
||
|
||
</div>
|
||
|
||
⤴️ 🚥 👆 🚶 📛 `/openapi.json`, `/docs`, ⚖️ `/redoc` 👆 🔜 🤚 `404 Not Found` ❌ 💖:
|
||
|
||
```JSON
|
||
{
|
||
"detail": "Not Found"
|
||
}
|
||
```
|