Class PactContract

Namespace
Kuestenlogik.Bowire.Contracts
Assembly
Kuestenlogik.Bowire.Contracts.dll

Pact-compatible consumer contract (#191). A deliberately small subset of the Pact v3 specification — enough that a Pact Broker accepts a published document and that bowire contract verify can replay each interaction against a live provider. Serialised camelCase so the wire shape matches what brokers expect (consumer.name / provider.name / interactions[]).

public sealed class PactContract
Inheritance
PactContract
Inherited Members

Remarks

#364 — moved from the CLI (Kuestenlogik.Bowire.Tool) into this shared package so the workbench endpoint + MCP tool verify through the same engine as the CLI, and made public for those cross-assembly callers.

Constructors

PactContract()

public PactContract()

Properties

Consumer

[JsonPropertyName("consumer")]
public PactParty Consumer { get; set; }

Property Value

PactParty

Interactions

[JsonPropertyName("interactions")]
public List<PactInteraction> Interactions { get; init; }

Property Value

List<PactInteraction>

Metadata

Pact metadata block. Carries the spec version brokers key off plus a bowire provenance stamp so a round-tripped contract is traceable to the recording it came from.

[JsonPropertyName("metadata")]
public PactMetadata Metadata { get; set; }

Property Value

PactMetadata

Provider

[JsonPropertyName("provider")]
public PactParty Provider { get; set; }

Property Value

PactParty

Methods

FromRecording(BowireRecording, string, string)

Build a consumer contract from a captured recording. Only REST / HTTP steps become interactions — Pact is an HTTP contract format and brokers reject non-HTTP shapes; other protocols are skipped and reported by the caller. Each step's request (verb + path + body + header metadata) and recorded response (status + body) become one interaction.

public static PactContract FromRecording(BowireRecording recording, string consumer, string provider)

Parameters

recording BowireRecording
consumer string
provider string

Returns

PactContract