test(backend): pin OpenAPI contract baseline (360 paths, 484 operations)

Adds tests/contracts/test_openapi_baseline.py which loads the live
FastAPI app and diffs its OpenAPI schema against a checked-in baseline.
Fails on:
  - Any removed path or operation
  - Any removed response status code on an existing operation
  - Any new required request body field (would break existing clients)

Passes silently on additive changes. The baseline is regenerated by
running tests/contracts/regenerate_baseline.py — only when a contract
change has been reviewed and every consumer (admin-compliance,
developer-portal, SDKs) has been updated in the same change set.

This is the safety harness for the Phase 1 backend-compliance refactor:
every subsequent refactor commit must keep this test green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-07 13:10:11 +02:00
parent cb90d0db0c
commit 7806425ba6
4 changed files with 49504 additions and 0 deletions

File diff suppressed because it is too large Load Diff