REST API Integration and Contract Test Suites
Builds REST API integration and contract test suites with auth matrices, schema checks, and isolated test data that won't flake.
Before & after
Same prompt, same agent — the only difference is the skill.
I can help you build an integration test suite for your REST API. A good suite typically covers: - **Happy path** — each endpoint returns expected results with valid input - **Validation** — invalid input returns appropriate error codes - **Authentication** — protected endpoints reject unauthorized requests - **Edge cases** — empty results, pagination, boundaries - **Error handling** — server errors are handled gracefully You'd want to test status codes, response bodies, and headers. Using a framework like Jest with supertest (Node) or pytest with requests (Python) works well. Can you share your API endpoints or an OpenAPI spec?
Integration test suite — generated per endpoint, and crucially including
the tests people skip because they're tedious, which are the ones that
catch real bugs.
STRUCTURE — per endpoint, not per "feature"
POST /users
✓ 201 + body matches schema on valid input (happy path)
✓ 400 on missing required field (validation)
✓ 400 on wrong type (string where int expected)
✓ 401 without auth token (auth)
✓ 403 with valid token, wrong permissions ← usually skipped
✓ 409 on duplicate email (conflict)
✓ 422 on malformed but well-typed input
GET /users?page=2
✓ pagination returns correct slice + total count
✓ empty result set returns [] not null ← the null bug
✓ out-of-range page returns empty, not error
THE TESTS THAT ACTUALLY FIND BUGS
Happy-path tests pass on day one and rarely fail again. The value is in:
• the 403 case (valid token, wrong role) — the most common real auth
hole, and the most commonly untested
• empty-result shape ("[]" vs "null") — breaks clients silently
• the boundary between 400 and 422 — malformed vs. invalid
These are what I generate by default, because a suite that only tests
happy paths gives false confidence.
CONTRACT TESTS
If you have an OpenAPI spec, I generate tests that assert every response
matches the declared schema — so a backend change that drifts from the
contract fails CI instead of breaking a client in prod.
WHAT I NEED
The endpoints or an OpenAPI spec. With a spec I can generate the full
suite including contract tests; without one I generate from the endpoint
list and you fill in the auth model. Which do you have?About this skill
Your API tests are green and prod still breaks: a renamed field slips through because the test only checked for a 200, nobody tested whether one customer can read another's records, and the suite passes locally but fails randomly in CI. This skill builds API test suites the way a senior test engineer does. It maps every endpoint against the cases that actually catch bugs, then writes runnable tests in your stack.
What it does
- Builds an endpoint-by-case coverage matrix covering happy paths, validation, auth and tenant boundaries, state transitions, idempotency, and pagination, so gaps are visible decisions
- Checks every response against your OpenAPI spec with a real validator, along with status codes, headers, and computed values
- Tests the most-skipped security cases: expired tokens, wrong roles, cross-tenant ID access, and mass assignment of privileged fields
- Gives each test its own data and removes flake sources: fixed sleeps, shared fixtures, order assumptions, and unfrozen clocks
- Sets up CI contract guards that fail on breaking spec changes such as removed fields, type changes, or newly required inputs
- Reviews an existing suite, ranks the missing cases and flaky patterns by risk, and proposes targeted diffs
What you get
A coverage matrix plus runnable test files (pytest, Jest/Vitest + supertest, REST Assured, or Go httptest), with the run command, a list of gaps and spec mismatches, and stated assumptions you can confirm or correct.
Best for
Backend and full-stack engineers, QA engineers, and platform teams who own REST APIs with real consumers, such as mobile apps, partners, or other services, and need tests that catch breaking changes before release.
SKILL.md preview
---
name: rest-api-integration-contract-tests
… (sign up to view the full skill)More development skills
View all Development skills →React and Next.js Regression Test Coverage
Generate React and Next.js tests with Jest, Testing Library, MSW, and Playwright, prioritized by regression risk.
Playwright E2E Tests and Flake Repair
Build reliable Playwright tests, repair flakes from evidence, migrate suites, and configure faster, diagnosable CI.
Pre-Ship Verification for Code Changes
Before calling a code change done, Claude grades every claim by evidence, tries to break it, and reports what's verified vs assumed.
TestRail Case and CI Result Sync
Sync automated tests to TestRail cases and scoped runs with stable mappings, retry handling, and verified result counts.