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:
@@ -0,0 +1,47 @@
|
||||
set dotenv-load
|
||||
|
||||
default:
|
||||
@just --list
|
||||
|
||||
build:
|
||||
cargo build
|
||||
|
||||
release:
|
||||
cargo build --release
|
||||
|
||||
run:
|
||||
cargo run
|
||||
|
||||
run-debug:
|
||||
RUST_LOG=debug cargo run
|
||||
|
||||
test:
|
||||
cargo test --workspace
|
||||
|
||||
test-mocks:
|
||||
cargo test --features test_utils
|
||||
|
||||
test-one name:
|
||||
cargo test {{name}}
|
||||
|
||||
fmt:
|
||||
cargo fmt --all
|
||||
|
||||
fmt-check:
|
||||
cargo fmt --all --check
|
||||
|
||||
lint:
|
||||
cargo clippy -- -D warnings
|
||||
|
||||
check:
|
||||
cargo fmt --all
|
||||
cargo clippy -- -D warnings
|
||||
|
||||
openapi:
|
||||
cargo run --bin generate-openapi
|
||||
|
||||
db:
|
||||
docker compose up -d postgres
|
||||
|
||||
db-down:
|
||||
docker compose down
|
||||
Reference in New Issue
Block a user