setup-contract-tests

Automate contract testing setup for microservices using OpenAPI and JSON Schema.

Updated Oct 27, 2025
One-click install
npx skills add https://github.com/mariotoffia/gobridge --skill setup-contract-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-contract-tests
Source: https://github.com/mariotoffia/gobridge/tree/main/.cursor/skills/setup-contract-tests
Command: npx skills add https://github.com/mariotoffia/gobridge --skill setup-contract-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured, repeatable approach to contract testing for microservices, including OpenAPI, JSON Schema, and consumer-driven testing, so teams can catch integration issues early and maintain compatibility.

Core Features & Use Cases

  • Organize contracts in /contracts for API and event schemas.
  • Create consumer expectations and mock servers to verify interactions.
  • Integrate contract tests into CI/CD pipelines with validation of schemas and compatibility.

Quick Start

Follow the guide to configure contracts, place OpenAPI and JSON Schema files under /contracts, and run the contract tests using the project Makefile targets (e.g., test-contracts) in CI or locally.

Frequently Asked Questions about setup-contract-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up contract testing for microservices using OpenAPI?

Contract testing for microservices is set up by organizing OpenAPI and JSON Schema files in a /contracts directory, defining consumer expectations, generating mock servers, and verifying producer compliance. This Skill automates that structured setup and validation process.

What is consumer-driven contract testing and when do I need it?

Consumer-driven contract testing validates API interactions by verifying that producers meet consumer expectations defined in OpenAPI and JSON Schema. You need it to catch integration issues early and maintain compatibility across microservices before deploying to production.

How do I integrate OpenAPI contract validation into a CI/CD pipeline?

OpenAPI contract validation integrates into CI/CD pipelines by running automated tests against schemas and compatibility rules using Makefile targets like test-contracts. This ensures contract loading, schema validation, and producer verification execute automatically on every code change.

Can I validate event contracts and JSON Schema separately from REST APIs?

Yes, event contract validation and JSON Schema verification are supported independently of REST APIs. The Skill handles both API contracts and event schemas placed under the /contracts directory, ensuring consumer expectations and schema compliance for asynchronous workflows.

What's the best way to generate mock servers from OpenAPI specifications for testing?

The best way to generate mock servers from OpenAPI specifications is through consumer-driven testing workflows that load contracts from a central /contracts directory. This approach verifies consumer expectations against mock interactions before validating the actual producer service.

Why do my microservices integration tests fail even with valid OpenAPI specifications?

Integration tests fail despite valid OpenAPI specifications when consumer expectations and producer implementations diverge. Contract testing catches this by validating consumer-driven expectations against producer responses, ensuring schema compatibility and interaction compliance before deployment.