Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api2spec-fixture-actix

A sample Actix-web API fixture for testing api2spec's Actix framework plugin.

Prerequisites

  • Rust (1.70+)
  • Cargo

Build

cargo build

For a release build:

cargo build --release

Run

cargo run

The server will start on http://0.0.0.0:8080.

API Endpoints

Health

  • GET /health - Health check
  • GET /health/ready - Readiness check

Users

  • GET /users - List all users
  • POST /users - Create a new user
  • GET /users/{id} - Get user by ID
  • PUT /users/{id} - Update user by ID
  • DELETE /users/{id} - Delete user by ID
  • GET /users/{id}/posts - Get posts by user ID

Posts

  • GET /posts - List all posts
  • POST /posts - Create a new post
  • GET /posts/{id} - Get post by ID

Example Requests

# 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

About

Actix-web fixture for api2spec testing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages