Modern API Testing Framework

A powerful, extensible API testing tool built with .NET 8 that allows you to define and execute HTTP API tests using YAML or JSON specifications. Comprehensive validation, authentication support, and detailed reporting capabilities with enterprise-grade CI/CD integration.

✨ Key Features

Multi-format Support

Define tests in YAML or JSON format with intuitive syntax and comprehensive validation options.

Authentication Support

Built-in support for Basic Auth, Bearer Token, and API Key authentication methods.

Comprehensive Validation

Validate status codes, response bodies, headers, and response times with configurable expectations.

Detailed Reporting

Generate comprehensive Markdown reports with test results, response times, and detailed analysis.

Extensible Architecture

Built with SOLID principles and dependency injection for easy extension and customization.

High Performance

Async/await support and optimized execution for fast, reliable API testing at scale.

🔄 CI/CD Integration

Enterprise-grade automation with comprehensive security scanning and deployment capabilities

Automated Pipeline

Complete CI/CD pipeline with build, test, security scanning, and deployment automation.

Security Scanning

OWASP Dependency Check, CodeQL, Semgrep, Trivy, and secrets detection integrated.

Container Support

Multi-stage Docker builds, Docker Compose, and automated container security scanning.

Multi-Environment

Staging and production deployments with approval gates and automatic rollback.

Real-time Notifications

Slack integration for deployment status, security alerts, and build notifications.

Monitoring & Metrics

Code coverage reporting, security metrics, and performance monitoring dashboards.

🔒 Security Features

Comprehensive security scanning and compliance monitoring

Dependency Scanning

Automated vulnerability detection in dependencies with OWASP Dependency Check.

Code Analysis

Static code analysis with CodeQL and Semgrep for security vulnerabilities.

Secrets Detection

Automated detection of exposed secrets with TruffleHog and Gitleaks.

Container Security

Docker image vulnerability scanning with Trivy and Hadolint.

Compliance Checks

License validation, security policy enforcement, and standards compliance.

Security Alerts

Real-time security notifications and automated vulnerability reporting.

📝 Test Examples

Basic GET Request

Basic API Test
- name: "Get User Data"
  request:
    method: "GET"
    url: "https://api.example.com/users/1"
    headers:
      Accept: "application/json"
  expect:
    statusCode: 200
    maxResponseTimeMs: 5000

POST Request with Authentication

Authenticated POST Request
- name: "Create User with Bearer Token"
  request:
    method: "POST"
    url: "https://api.example.com/users"
    headers:
      Content-Type: "application/json"
    auth:
      type: "bearer"
      token: "your-jwt-token"
    body:
      name: "John Doe"
      email: "john@example.com"
  expect:
    statusCode: 201
    body:
      id: 123
      name: "John Doe"

Using Variables

Dynamic Testing with Variables
variables:
  base_url: "https://api.example.com"
  api_key: "your-api-key"

- name: "Test with Variables"
  request:
    method: "GET"
    url: "{{base_url}}/users"
    auth:
      type: "apikey"
      in: "header"
      name: "X-API-Key"
      value: "{{api_key}}"
  expect:
    statusCode: 200

🏗️ Architecture

SpecAPI is built with modern software engineering practices and follows SOLID principles

Test Execution Pipeline

Test Specification
Test Loader
Test Runner
Validators
Reporter

Extensible Framework

Easy to extend with custom validators, authentication handlers, and reporters through well-defined interfaces.

Modular Design

Clean separation of concerns with dependency injection for maintainable and testable code.

High Performance

Async/await support and optimized execution for fast, reliable API testing at scale.

3+

Authentication Methods

4+

Validation Types

6+

Security Tools

Extensibility

🚀 Getting Started

Quick Installation

Installation Commands
# Clone the repository
git clone https://github.com/sully8665/specapi.git
cd SpecAPI

# Build the project
dotnet build src/SpecAPI/SpecAPI.csproj

# Run your first test
dotnet run --project src/SpecAPI/SpecAPI.csproj Examples/example-test.yaml

# Or use Docker
docker build -t specapi .
docker run specapi Examples/example-test.yaml

Prerequisites

  • .NET 8.0 SDK or later
  • Basic knowledge of HTTP APIs
  • YAML or JSON familiarity
  • Docker (optional, for containerized deployment)

CI/CD Setup

SpecAPI comes with comprehensive CI/CD integration out of the box. The GitHub Actions workflows provide:

  • Automated security scanning and vulnerability detection
  • Multi-platform builds and Docker containerization
  • Automated deployment to staging and production environments
  • Real-time notifications and monitoring