New advertisers: 50% off your first month with code FIRSTMONTHSee slots
aj-geddes avatar

Api Contract Testing

Contract testing guide for consumer-driven Pact tests, OpenAPI and JSON Schema validation, and breaking-change prevention.

skills.sh installs
933
GitHub stars
387
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers consumer-driven contract testing between services, validating request and response formats, types, and error behavior without full integration tests
  • Includes reference guides for Pact, OpenAPI and JSON Schema validation, REST Assured for Java, Postman contract tests, and Pact Broker sharing
  • Provides a TypeScript Pact example with matchers such as like, eachLike, and iso8601DateTimeWithMillis for flexible structural checks
  • Designed for microservice teams that need to catch breaking API changes and contract violations in CI

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill api-contract-testing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

API Contract Testing

Table of Contents

Overview

Contract testing verifies that APIs honor their contracts between consumers and providers. It ensures that service changes don't break dependent consumers without requiring full integration tests. Contract tests validate request/response formats, data types, and API behavior independently.

When to Use

  • Testing microservices communication
  • Preventing breaking API changes
  • Validating API versioning
  • Testing consumer-provider contracts
  • Ensuring backward compatibility
  • Validating OpenAPI/Swagger specifications
  • Testing third-party API integrations
  • Catching contract violations in CI

Quick Start

Minimal working example:

// tests/pact/user-service.pact.test.ts
import { PactV3, MatchersV3 } from "@pact-foundation/pact";
import { UserService } from "../../src/services/UserService";

const { like, eachLike, iso8601DateTimeWithMillis } = MatchersV3;

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Testing & QA, Backend & APIs
First seen
May 16, 2026

More from aj-geddes/useful-ai-prompts

All 258

Similar to Api Contract Testing

More Testing & QA