fastapi/docs/em/docs/tutorial/path-operation-configuratio...

5.2 KiB
Raw Blame History

🛠️ 📳

📤 📚 🔢 👈 👆 💪 🚶‍♀️ 👆 🛠️ 👨‍🎨 🔗 .

/// warning

👀 👈 👫 🔢 🚶‍♀️ 🔗 🛠️ 👨‍🎨, 🚫 👆 🛠️ 🔢.

///

📨 👔 📟

👆 💪 🔬 (🇺🇸🔍) status_code ⚙️ 📨 👆 🛠️.

👆 💪 🚶‍♀️ 🔗 int 📟, 💖 404.

🚥 👆 🚫 💭 🔠 🔢 📟, 👆 💪 ⚙️📉 status:

//// tab | 🐍 3.6 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial001.py!}

////

//// tab | 🐍 3.9 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial001_py39.py!}

////

//// tab | 🐍 3.10 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial001_py310.py!}

////

👈 👔 📟 🔜 ⚙️ 📨 & 🔜 🚮 🗄 🔗.

/// note | "📡 "

👆 💪 ⚙️ from starlette import status.

FastAPI 🚚 🎏 starlette.status fastapi.status 🏪 👆, 👩‍💻. 👟 🔗 ➡️ 💃.

///

🔖

👆 💪 🚮 🔖 👆 🛠️, 🚶‍♀️ 🔢 tags ⏮️ list str (🛎 1 str):

//// tab | 🐍 3.6 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial002.py!}

////

//// tab | 🐍 3.9 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial002_py39.py!}

////

//// tab | 🐍 3.10 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial002_py310.py!}

////

👫 🔜 🚮 🗄 🔗 & ⚙️ 🏧 🧾 🔢:

🔖 ⏮️ 🔢

🚥 👆 ✔️ 🦏 🈸, 👆 5📆 🔚 🆙 📈 📚 🔖, & 👆 🔜 💚💭 👆 🕧 ⚙️ 🎏 🔖 🔗 🛠️.

👫 💼, 💪🔑 🏪 🔖 Enum.

FastAPI 🐕‍🦺 👈 🎏 🌌 ⏮️ 🎻:

{!../../../docs_src/path_operation_configuration/tutorial002b.py!}

📄 & 📛

👆 💪 🚮 summary & description:

//// tab | 🐍 3.6 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial003.py!}

////

//// tab | 🐍 3.9 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial003_py39.py!}

////

//// tab | 🐍 3.10 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial003_py310.py!}

////

📛 ➡️ #️⃣

📛 😑 📏 & 📔 💗 ⏸, 👆 💪 📣 🛠️ 📛 🔢 #️⃣ & FastAPI 🔜 ➡️ 📤.

👆 💪 #️⃣ , 🔜 🔬 & 🖥 ☑ ( 🔘 🏧 #️⃣ 📐).

//// tab | 🐍 3.6 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial004.py!}

////

//// tab | 🐍 3.9 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial004_py39.py!}

////

//// tab | 🐍 3.10 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial004_py310.py!}

////

🔜 ⚙️ 🎓 🩺:

📨 📛

👆 💪📨 📛 ⏮️ 🔢 response_description:

//// tab | 🐍 3.6 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial005.py!}

////

//// tab | 🐍 3.9 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial005_py39.py!}

////

//// tab | 🐍 3.10 & 🔛

{!> ../../../docs_src/path_operation_configuration/tutorial005_py310.py!}

////

/// info

👀 👈 response_description 🔗 🎯 📨, description 🔗 🛠️ 🏢.

///

/// check

🗄 ✔ 👈 🔠 🛠️ 🚚 📨 📛.

, 🚥 👆 🚫 🚚 1, FastAPI 🔜 🔁 🏗 1 "🏆 📨".

///

😢 🛠️

🚥 👆 💪🛠️ 😢, 🍵 , 🚶‍♀️ 🔢 deprecated:

{!../../../docs_src/path_operation_configuration/tutorial006.py!}

🔜 🎯😢 🎓 🩺:

😢 & 🚫-😢 🛠️ 👀 💖:

🌃

👆 💪 🔗 & 🚮 🗃 👆 🛠️ 💪 🚶‍♀️ 🔢 🛠️ 👨‍🎨.