Fast and Type-Safe OpenApi implementation for soai.
*** `soai` allows you to easily implement Apis that comply with the `OpenApiv3` specification. It uses procedural macros to generate a lots of boilerplate code, so that you only need to focus on the more important business implementations. * [Docs](https://docs.rs/soai) * [Cargo package](https://crates.io/crates/soai) ## Features * **Type safety** If your codes can be compiled, then it is fully compliant with the `OpenApi v3` specification. * **Rustfmt friendly** Do not create any DSL that does not conform to Rust's syntax specifications. * **IDE friendly** Any code generated by the procedural macro will not be used directly. * **Minimal overhead** All generated code is necessary, and there is almost no overhead. ## Crate features To avoid compiling unused dependencies, soai gates certain features, some of which are disabled by default: | Feature | Description | |--------------|----------------------------------------------------------------------------------| | chrono | Integrate with the [`chrono` crate](https://crates.io/crates/chrono). | | swagger-ui | Add swagger UI support | | rapidoc | Add RapiDoc UI support | | redoc | Add Redoc UI support | | email | Support for email address string | | hostname | Support for hostname string | | uuid | Integrate with the [`uuid` crate](https://crates.io/crates/uuid) | | url | Integrate with the [`url` crate](https://crates.io/crates/url) | | bson | Integrate with the [`bson` crate](https://crates.io/crates/bson) | | rust_decimal | Integrate with the [`rust_decimal` crate](https://crates.io/crates/rust_decimal) | | static-files | Support for static file response | ## Safety This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% Safe Rust. ## Example ```rust use soai::{listener::TcpListener, Route}; use soai::{param::Query, payload::PlainText, OpenApi, OpenApiService}; struct Api; #[OpenApi] impl Api { #[oai(path = "/hello", method = "get")] async fn index(&self, name: Query