You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.7 KiB

↔ 🗄

!!! warning 👉 👍 🏧 ⚒. 👆 🎲 💪 🚶 ️.

🚥 👆 📄 🔰 - 👩‍💻 🦮, 👆 💪 🎲 🚶 👉 📄.

🚥 👆 ⏪ 💭 👈 👆 💪 🔀 🏗 🗄 🔗, 😣 👂.

📤 💼 🌐 👆 💪 💪 🔀 🏗 🗄 🔗.

👉 📄 👆 🔜 👀 .

😐 🛠️

😐 (🔢) 🛠️, .

FastAPI 🈸 (👐) ✔️ .openapi() 👩‍🔬 👈 📈 📨 🗄 🔗.

🍕 🈸 🎚 🏗, 🛠️ /openapi.json (⚖️ 👆👆 openapi_url) ®.

📨 🎻 📨 ⏮️ 🏁 🈸 .openapi() 👩‍🔬.

🔢, 👩‍🔬 .openapi() 🔨 🏠 .openapi_schema 👀 🚥 ✔️ 🎚 & 📨 👫.

🚥 🚫, ️ 🏗 👫 ⚙️ 🚙 🔢 fastapi.openapi.utils.get_openapi.

& 👈 🔢 get_openapi() 📨 🔢:

  • title: 🗄 📛, 🎦 🩺.
  • version: 👆 🛠️, 2.5.0.
  • openapi_version: 🗄 🔧 ⚙️. 🔢, : 3.0.2.
  • description: 📛 👆 🛠️.
  • routes: 📇 🛣, 👫 🔠 ® 🛠️. 👫 ➡️ app.routes.

🔑 🔢

⚙️🔛, 👆 💪 ⚙️ 🎏 🚙 🔢 🏗 🗄 🔗 & 🔐 🔠 🍕 👈 👆 💪.

🖼, ➡️ 🚮 📄 🗄 ↔ 🔌 🛃 🔱.

😐 FastAPI

🥇, ✍ 🌐 👆 FastAPI 🈸 🛎:

{!../../../docs_src/extending_openapi/tutorial001.py!}

🏗 🗄 🔗

⤴️, ⚙️ 🎏 🚙 🔢 🏗 🗄 🔗, 🔘 custom_openapi() 🔢:

{!../../../docs_src/extending_openapi/tutorial001.py!}

🔀 🗄 🔗

🔜 👆 💪 🚮 📄 ↔, 🛃 x-logo info "🎚" 🗄 🔗:

{!../../../docs_src/extending_openapi/tutorial001.py!}

💾 🗄 🔗

👆 💪 ⚙️ 🏠 .openapi_schema "💾", 🏪 👆 🏗 🔗.

👈 🌌, 👆 🈸 🏆 🚫 ✔️ 🏗 🔗 🔠 🕰 👩‍💻 📂 👆 🛠️ 🩺.

🔜 🏗 🕴 🕐, & ⤴️ 🎏 💾 🔗 🔜 ⚙️📨.

{!../../../docs_src/extending_openapi/tutorial001.py!}

🔐 👩‍🔬

🔜 👆 💪 .openapi() 👩‍🔬 ⏮️ 👆 🆕 🔢.

{!../../../docs_src/extending_openapi/tutorial001.py!}

🕐 👆 🚶 http://127.0.0.1:8000/redoc 👆 🔜 👀 👈 👆 ⚙️ 👆 🛃 🔱 (👉 🖼, FastAPI'Ⓜ 🔱):