{"repo":"0b01001001/spectree","free":true,"listed":false,"github":"https://github.com/0b01001001/spectree","clone":"git clone https://github.com/0b01001001/spectree.git","description":"API spec validator and OpenAPI document generator for Python web frameworks.","language":"Python","stars":362,"topics":["apispec","openapi","swagger","redoc","flask","falcon","annotation","pydantic","annotations","starlette"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":"SpecTree Yet another library to generate OpenAPI documents and validate requests & responses with Python annotations. If all you need is a framework-agnostic library that can generate OpenAPI document, check defspec. Features Less boilerplate code, only annotations, no need for YAML :sparkles: Generate API document with Redoc UI, Scalar UI or Swagger UI :yum: Validate query, JSON data, and response data with supported model backends :wink: pydantic msgspec others if you implement the model adapter protocol Current support: Flask demo Quart demo Falcon demo Starlette demo Quick Start Install with pip: If you want to install with offline OpenAPI web pages support: Offline mode doesn't support SwaggerUI OAuth2 redirection. If you want to use msgspec instead of pydantic : Examples Check the examples folder. flask example quart example falcon example with logging when validation failed falcon example with msgspec models starlette example Step by Step 1. Define your data structures for query , json , headers , cookies , and resp with the model backend you configured for SpecTree 2. create spectree.SpecTree instance with the web framework name you are using, like api = SpecTree('flask') . SpecTree uses the pydantic adapter by default, or you can pass another adapter explicitly with model adapter=... . 3. api.validate decorate the route with (the default value is given in parentheses): query json headers cookies resp tags (no tags on endpoint) security ( None - endpoint is not secure","default_branch":null,"files":null,"tree":[],"storefront":"/r/0b01001001","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/0b01001001/spectree/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."}