mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-30 09:39:20 -05:00
1.3 KiB
1.3 KiB
🎻 🔗 🔢
📤 💼 🌐❔ 👆 5️⃣📆 💪 🗜 💽 🆎 (💖 Pydantic 🏷) 🕳 🔗 ⏮️ 🎻 (💖 dict, list, ♒️).
🖼, 🚥 👆 💪 🏪 ⚫️ 💽.
👈, FastAPI 🚚 jsonable_encoder() 🔢.
⚙️ jsonable_encoder
➡️ 🌈 👈 👆 ✔️ 💽 fake_db 👈 🕴 📨 🎻 🔗 💽.
🖼, ⚫️ 🚫 📨 datetime 🎚, 👈 🚫 🔗 ⏮️ 🎻.
, datetime 🎚 🔜 ✔️ 🗜 str ⚗ 💽 💾 📁.
🎏 🌌, 👉 💽 🚫🔜 📨 Pydantic 🏷 (🎚 ⏮️ 🔢), 🕴 dict.
👆 💪 ⚙️ jsonable_encoder 👈.
⚫️ 📨 🎚, 💖 Pydantic 🏷, & 📨 🎻 🔗 ⏬:
{* ../../docs_src/encoder/tutorial001.py hl[5,22] *}
👉 🖼, ⚫️ 🔜 🗜 Pydantic 🏷 dict, & datetime str.
🏁 🤙 ⚫️ 🕳 👈 💪 🗜 ⏮️ 🐍 🐩 json.dumps().
⚫️ 🚫 📨 ⭕ str ⚗ 💽 🎻 📁 (🎻). ⚫️ 📨 🐍 🐩 💽 📊 (✅ dict) ⏮️ 💲 & 🎧-💲 👈 🌐 🔗 ⏮️ 🎻.
/// note
jsonable_encoder 🤙 ⚙️ FastAPI 🔘 🗜 💽. ✋️ ⚫️ ⚠ 📚 🎏 😐.
///