{"repo":"ProbablyClem/utoipauto","free":true,"listed":false,"github":"https://github.com/ProbablyClem/utoipauto","clone":"git clone https://github.com/ProbablyClem/utoipauto.git","description":"Rust Macros to automate the addition of Paths/Schemas to Utoipa crate, simulating Reflection during the compilation phase","language":"Rust","stars":196,"topics":["code-first","openapi","openapi-generator","schema","swagger","swagger-ui","utoipa"],"license":"Apache-2.0","category":"api-integrations-sdks","readme_excerpt":"Utoipauto Rust Macros to automate the addition of Paths/Schemas to Utoipa crate, simulating Reflection during the compilation phase Crate presentation Utoipa is a great crate for generating documentation (openapi/swagger) via source code. But since Rust is a static programming language, we don't have the possibility of automatically discovering paths and dto in runtime and adding them to the documentation, For APIs with just a few endpoints, it's not that much trouble to add controller functions one by one, and DTOs one by one. But, if you have hundreds or even thousands of endpoints, the code becomes very verbose and difficult to maintain. Ex : The goal of this crate is to propose a macro that automates the detection of methods carrying Utoipa macros ( #[utoipa::path(...] ), and adds them automatically. (it also detects sub-modules.) It also detects struct that derive or implement ToSchema for the components(schemas) section, and the ToResponse for the components(responses) section. Features - [x] Automatic recursive path detection - [x] Automatic import from module - [x] Automatic import from src folder - [x] Automatic model detection - [x] Automatic response detection - [x] Works with workspaces - [x] Exclude a method from automatic scanning - [x] Custom path detection How to use it Simply add the crate utoipauto to the project Import macro Then add the #[utoipauto] macro just before the #[derive(OpenApi)] and #[openapi] macros. Important !! Put #[utoipauto] before #[deriv","default_branch":null,"files":null,"tree":[],"storefront":"/r/ProbablyClem","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ProbablyClem/utoipauto/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."}