Class ContractVerifier
- Namespace
- Kuestenlogik.Bowire.Contracts
- Assembly
- Kuestenlogik.Bowire.Contracts.dll
Provider-side contract verification (#191). Replays every interaction in a consumer contract against the provider's live base URL and checks the actual response satisfies the contract: the status code must match, and the response body must satisfy the expected shape (structural match — the provider may add fields / vary values, but every field the consumer relies on must be present with the same JSON kind).
public static class ContractVerifier
- Inheritance
-
ContractVerifier
- Inherited Members
Remarks
#364 — moved out of the CLI into this shared package so the workbench
endpoint and the MCP tool verify through the same engine as
bowire contract verify. It now returns the engine-native
ContractVerificationReport (structured consumer/provider
- timestamp for the matrix); the CLI adapter maps that onto its generic
RunReportfor the shared JUnit / SARIF emitters.
Methods
VerifyAsync(HttpClient, PactContract, string, TextWriter?, CancellationToken)
Verify contract against baseUrl.
FailedInteractions > 0
means the provider broke the contract. stdout is
optional — the CLI passes its console for the live PASS/FAIL log;
the endpoint and MCP callers pass null.
public static Task<ContractVerificationReport> VerifyAsync(HttpClient http, PactContract contract, string baseUrl, TextWriter? stdout, CancellationToken ct)
Parameters
httpHttpClientcontractPactContractbaseUrlstringstdoutTextWriterctCancellationToken