The Hexendrum API includes interactive Swagger UI documentation for exploring and testing the API endpoints.
-
Start the Rust backend:
cargo run
-
Open Swagger UI in your browser: Navigate to:
http://127.0.0.1:3030/swagger-ui -
View OpenAPI JSON specification: Navigate to:
http://127.0.0.1:3030/api-doc/openapi.json
The Swagger UI provides:
- Interactive API Testing: Try out API endpoints directly from the browser
- Schema Documentation: View request/response schemas with examples
- Endpoint List: Browse all available API endpoints
- Request Builder: Build and test requests with proper formatting
GET /api/health- Health check
GET /api/library/tracks- Get all tracksPOST /api/library/scan- Scan directoriesGET /api/library/search?q={query}- Search tracksGET /api/library/stats- Get statistics
GET /api/playlists- Get all playlistsPOST /api/playlists/{id}/cleanup- Cleanup specific playlistPOST /api/playlists/cleanup- Cleanup all playlists
All request and response schemas are documented with:
- Field descriptions
- Example values
- Data types
- Required/optional fields
TrackResponse- Track informationApiResponseTracks- Response wrapper for tracksScanRequest- Library scan requestSearchQuery- Search parametersLibraryStats- Library statisticsPlaylistResponse- Playlist information
- Open
http://127.0.0.1:3030/swagger-ui - Expand any endpoint section
- Click "Try it out"
- Fill in parameters (if any)
- Click "Execute"
- View the response
- Go to Swagger UI
- Find
POST /api/library/scan - Click "Try it out"
- Enter request body:
{ "directories": ["/home/user/Music"] } - Click "Execute"
- View the response showing number of tracks found
- OpenAPI Version: 3.0
- Framework: utoipa + utoipa-swagger-ui
- Integration: Axum HTTP server
- Location:
/swagger-uiendpoint - OpenAPI Spec:
/api-doc/openapi.json
- The Swagger UI automatically includes CORS headers
- All schemas are automatically generated from Rust structs
- Example values are provided in schema annotations
- The documentation stays in sync with code changes