{"repo":"mike-oakley/openapi-pydantic","free":true,"listed":false,"github":"https://github.com/mike-oakley/openapi-pydantic","clone":"git clone https://github.com/mike-oakley/openapi-pydantic.git","description":"Modern, type-safe OpenAPI schemas in Python using Pydantic 1.8+ and 2.x","language":"Python","stars":122,"topics":["api","openapi","parser","pydantic","python","schema","validator"],"license":null,"category":"api-integrations-sdks","readme_excerpt":"openapi-pydantic Modern, type-safe OpenAPI schemas in Python using Pydantic 1.8+ and 2.x --- Table of Contents - Table of Contents - ✨ Features - 📦 Installation - 🚀 Quick Start - 📝 Usage Examples - 🧑‍💻 Using Pydantic Classes as Schema - Notes - Use of OpenAPI.model\\ dump() / OpenAPI.model\\ dump\\ json() / OpenAPI.json() / OpenAPI.dict() - Non-pydantic schema types - Use OpenAPI 3.0 instead of 3.1 - Pydantic version compatibility - 🙏 Credits - 📄 License --- ✨ Features - Supports both Pydantic 1.8+ and 2.x - Supports the OpenAPI 3.1 specification (with 3.0) also available) - Easy construction of OpenAPI schemas using Python objects or dicts - Seamless integration with Pydantic models for request/response schemas - Utility functions for schema conversion and validation --- 📦 Installation --- 🚀 Quick Start Output --- 📝 Usage Examples Pydantic allows you to use object, dict, or mixed data for input. The following examples all produce the same OpenAPI result as above: --- 🧑‍💻 Using Pydantic Classes as Schema 💡 Tip: Use your own Pydantic models for request/response schemas and let openapi-pydantic handle the conversion! Output --- Notes Use of OpenAPI.model dump() / OpenAPI.model dump json() / OpenAPI.json() / OpenAPI.dict() ⚠️ Important: Always use by alias=True, exclude none=True when dumping models to JSON or dict, to ensure OpenAPI compatibility. More info about field aliases: OpenAPI version Field alias info --------------- ---------------- 3.1 here 3.0 here Non-pyd","default_branch":null,"files":null,"tree":[],"storefront":"/r/mike-oakley","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mike-oakley/openapi-pydantic/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}