A sample Actix-web API fixture for testing api2spec's Actix framework plugin.
- Rust (1.70+)
- Cargo
cargo buildFor a release build:
cargo build --releasecargo runThe server will start on http://0.0.0.0:8080.
GET /health- Health checkGET /health/ready- Readiness check
GET /users- List all usersPOST /users- Create a new userGET /users/{id}- Get user by IDPUT /users/{id}- Update user by IDDELETE /users/{id}- Delete user by IDGET /users/{id}/posts- Get posts by user ID
GET /posts- List all postsPOST /posts- Create a new postGET /posts/{id}- Get post by ID
# Health check
curl http://localhost:8080/health
# List users
curl http://localhost:8080/users
# Get user by ID
curl http://localhost:8080/users/1
# Create a user
curl -X POST http://localhost:8080/users \
-H "Content-Type: application/json" \
-d '{"id": 0, "name": "John", "email": "john@example.com"}'
# List posts
curl http://localhost:8080/posts
# Get user's posts
curl http://localhost:8080/users/1/posts