python-contract-test

Verify FastAPI responses and Redpanda event payloads against shared schemas.

1|Updated Jun 20, 2026
One-click install
npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill python-contract-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-contract-test
Source: https://github.com/shafibabar/SDLC-Artifact-Factory/tree/main/skills/python-contract-test
Command: npx skills add https://github.com/shafibabar/SDLC-Artifact-Factory --skill python-contract-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, pytest-asyncio, httpx, jsonschema, referencing, PyYAML, and includes references (resource) components.

What problem does it solve?

This skill prevents production outages caused by silent API or event schema drifts between independently deployed services by catching breaking changes at build time.

Core Features & Use Cases

  • Schema-Based Validation: Uses OpenAPI and JSON Schema to verify real handler responses and emitted events without requiring a heavy Pact broker.
  • Consumer-Driven Checks: Allows consumers to define and verify only the specific fields they rely on, ensuring provider changes don't break downstream dependencies.
  • Backward Compatibility: Includes automated checks to ensure event schema evolutions remain compatible with previously deployed versions.

Quick Start

Run the python-contract-test skill to validate the current service against the shared OpenAPI specification and pinned consumer expectations.

Frequently Asked Questions about python-contract-test

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

FAQPage Schema
How do I detect API schema breaking changes in Python at build time?

Build-time contract testing in Python detects API schema breaking changes by asserting real handler responses against shared OpenAPI specifications using pytest and jsonschema before deployment.

Do I need a Pact broker to run consumer-driven contract testing for FastAPI?

No, consumer-driven contract testing for FastAPI can run without a Pact broker by using file-pinned consumer expectations and jsonschema to verify specific relied-upon fields locally in CI.

How do I validate event payloads against JSON Schema in a pytest CI pipeline?

You validate event payloads in a pytest CI pipeline by asserting emitted Redpanda events against pinned JSON Schema definitions to ensure wire-level compatibility without external infrastructure.

Can I check backward compatibility of event schema evolutions using pytest?

Yes, automated backward compatibility checks verify that event schema evolutions remain compatible with previously deployed versions by validating real event payloads against shared schemas during the pytest run.

What is the best way to verify wire-level compatibility between independently deployed Python services?

Frugal, file-pinned contract testing is the best way to verify wire-level compatibility, using pytest and jsonschema to assert real API responses and event payloads against shared schemas.

Does contract testing work with Redpanda-based architectures without external infrastructure?

Yes, contract testing works with Redpanda-based architectures without external infrastructure by validating emitted event payloads directly against pinned JSON Schema definitions within the local pytest build environment.