| Crates.io | armature-openapi |
| lib.rs | armature-openapi |
| version | 0.1.1 |
| created_at | 2025-12-26 23:50:55.538829+00 |
| updated_at | 2025-12-29 01:19:21.75344+00 |
| description | OpenAPI specification generation for Armature APIs |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006450 |
| size | 111,212 |
OpenAPI/Swagger documentation for the Armature framework.
[dependencies]
armature-openapi = "0.1"
use armature_openapi::{OpenApi, swagger_ui};
use armature_core::Application;
#[derive(OpenApi)]
struct ApiDoc;
let app = Application::new()
.get("/users", list_users)
.post("/users", create_user)
.get("/swagger-ui/*", swagger_ui(ApiDoc::openapi()))
.get("/openapi.json", openapi_spec(ApiDoc::openapi()));
/// List all users
#[openapi(
summary = "List users",
responses(
(status = 200, description = "List of users", body = Vec<User>)
)
)]
async fn list_users() -> Json<Vec<User>> {
// ...
}
#[derive(ToSchema)]
struct CreateUser {
/// User's name
name: String,
/// User's email
email: String,
}
MIT OR Apache-2.0