FastAPI & Pydantic v2 OpenAPI Breaking-Change Gate for GitHub Actions & GitLab CI

Renaming one Pydantic v2 field or tightening an Optional[str] silently mutates your FastAPI OpenAPI 3.1 contract. Export app.openapi() in 1 line without running a server and block breaking PRs in <0.5s.

⚡ 1-Click Live Diagnostic • Zero Login • <1.5s Edge Execution

Run a Live Deterministic Check Right Now

Scan real corporate DNS via Cloudflare DoH, simulate a broken AI-agent OpenAPI PR, or audit WCAG 2.2 / EN 301 549 clauses instantly.

Test what happens when an AI coding agent makes an optional query parameter required and drops a response field without bumping MAJOR:

Optional: Paste or customize OpenAPI 3.x Base & Head JSON
Click Simulate Claude Code / Cursor Breaking PR to run POST /api/v1/diff live and inspect OAS-BREAK-* rules, SemVer MAJOR bump, and SOC 2 PR gating.

Drop-In GitHub Actions Workflow for FastAPI & Pydantic v2

FastAPI generates OpenAPI 3.1 schemas dynamically from your Python type hints and Pydantic v2 models. That convenience creates a hidden risk: a harmless-looking refactor in a shared Pydantic model can silently break iOS, Android, TypeScript SDK, or partner webhook consumers. Add this zero-Docker workflow to diff main vs. HEAD on every Pull Request (or run the Zero-Click FastAPI OpenAPI Demo):

name: FastAPI OpenAPI Breaking-Change Gate
on: [pull_request]

jobs:
  fastapi-contract-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Install app dependencies & export HEAD OpenAPI 3.1 JSON
        run: |
          pip install -r requirements.txt
          python -c "import json; from app.main import app; open('head-openapi.json','w').write(json.dumps(app.openapi()))"

      - name: Export BASE OpenAPI 3.1 JSON from origin/main
        run: |
          git worktree add /tmp/base-branch origin/${{ github.base_ref }}
          PYTHONPATH=/tmp/base-branch python -c "import json; from app.main import app; open('base-openapi.json','w').write(json.dumps(app.openapi()))"

      - name: Run SpecGate Deterministic Contract Diff
        uses: profalexandrezamboni-ui/specgate-action@v1.2.0
        with:
          base_spec: base-openapi.json
          head_spec: head-openapi.json
10-Second Onboarding Builder • Zero Docker

Generate Your Drop-In CI/CD or .pre-commit Config in 10 Seconds

Select your CI stack, deterministic gates, and repository scale to generate ready-to-commit YAML.

2. Deterministic Gates to Enforce
.github/workflows/specgate.yml
name: SpecGate Deterministic CI Gates
on: [pull_request]
jobs:
  deterministic-gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: profalexandrezamboni-ui/specgate-action@v1.2.0
        env:
          SPECGATE_API_KEY: ${{ secrets.SPECGATE_API_KEY }}
        with:
          base_spec: openapi/base.json
          head_spec: openapi/head.json
      - run: pipx run --spec git+https://github.com/profalexandrezamboni-ui/spfguard-cli@v1.2.0 spfguard-cli --domain example.com
Recommended for 3–15 Repositories: Starter Plan ($19/mo flat team rate) unlocks SPECGATE_API_KEY for up to 15 private/public repos, automated inline PR comments, and 1,000 checks/hr.

Transparent Pricing — Instant Activation via Paddle

Start free on up to 2 repositories or domains. Upgrade anytime for multi-repository governance, signed PR overrides, and compliance exports.

Free Open-Source

$0/mo
  • Up to 2 repositories / domains
  • Deterministic CLI & GitHub Action
  • Interactive Web Playground
  • 60 API requests/hour
Install from GitHub

Team & Compliance

$39/mo

Paddle Price ID: pri_01m72s8sgdake5vfj2ygs54x50

  • Unlimited repositories & domains
  • Auditable PR Sign-Off override workflow
  • SOC 2 Audit Trail & EN 301 549 exports
  • 10,000 API requests/hour
Subscribe Team — $39/mo

14-Day Self-Serve Refund Guarantee: Payments, sales tax, and VAT are handled by our Merchant of Record (Paddle). Cancel immediately or trigger an automated 14-day full refund anytime via POST /api/v1/support/ticket.

Frequently Asked Technical Questions

Can I export FastAPI's OpenAPI 3.1 schema in CI/CD without booting a live database or uvicorn server?

Yes. Calling json.dumps(app.openapi()) directly from Python inspects your FastAPI routes and Pydantic v2 models in memory in ~150ms without binding a TCP port or connecting to production databases.

Which Pydantic v2 changes trigger a MAJOR SemVer breaking-change verdict in SpecGate?

Removing a field from a response_model, changing an optional request field (str | None = None) to a required field (str), narrowing a Literal/Enum in a request body, or deleting a FastAPI router path immediately triggers FAIL_BREAKING_CHANGE and recommends a MAJOR version bump.