feat: add OpenAPI spec generation with utoipa and justfile
- Add utoipa v5 dependency with ToSchema derives on all REST API DTOs - Annotate free-function handlers with #[utoipa::path] (trash, share, favorites, recent) - Create ApiDoc struct with OpenApi derive registering 37 schemas across 7 tags - Add generate-openapi binary outputting resources/gen/openapi.json - Serve OpenAPI spec at GET /api/openapi.json (public, no auth) - Add justfile with common dev commands (build, test, lint, check, openapi, db)
This commit is contained in:
@@ -54,6 +54,7 @@ async_zip = { version = "0.0.18", features = ["tokio", "deflate"] }
|
||||
dashmap = "6"
|
||||
socket2 = { version = "0.6.2", features = ["all"] }
|
||||
urlencoding = "2.1.3"
|
||||
utoipa = { version = "5", features = ["axum_extras", "uuid", "chrono"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
@@ -63,6 +64,10 @@ integration_tests = []
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(integration_tests)'] }
|
||||
|
||||
[[bin]]
|
||||
name = "generate-openapi"
|
||||
path = "src/bin/generate-openapi.rs"
|
||||
|
||||
[build-dependencies]
|
||||
oxc_allocator = "0.116"
|
||||
oxc_parser = "0.116"
|
||||
|
||||
Reference in New Issue
Block a user