Expand description
Contract diff retrieval API Contract-diff retrieval API.
The contract_diff_middleware already captures every incoming
request into the global CaptureManager. Until now there was no
HTTP surface to read those captures back out or to run the diff
analyser against the deployment’s OpenAPI spec — the audit’s PR-3
gap.
§Endpoints (mounted under /__mockforge/api/contract-diff)
GET /captures?limit=<n>→ recent captures (default 100, capped 1000)GET /captures/{id}→ single capturePOST /analyze/{id}→ analyse one capture against the specPOST /analyze→ analyse the most recent N captures (defaults to 50)DELETE /captures→ wipe the in-memory storeGET /statistics→ simple counters from CaptureManager
Analysis loads the OpenAPI spec from the path the server was started
with (spec_path carried in this module’s state). A redeploy with a
new spec naturally takes effect on the next request.
Structs§
- Contract
Diff ApiState - Shared state for the contract-diff API. Cloneable.
Functions§
- contract_
diff_ api_ router - Build the contract-diff API router. Mount under
/__mockforge/api/contract-diff.