Skip to main content

API Contract Governance

Short answer

TestChimp API contract governance answers a question UI coverage alone cannot: which OpenAPI operations and schema fields did our SmartTests actually exercise? Connect your OpenAPI root files, opt in to API payload capture on Playwright runs, then use the APIs surface to see endpoint and field coverage—and turn gaps into issues, new tests, or deliberate ignores.

Why API contract governance matters

Your OpenAPI (or equivalent) spec is the business contract of your product: methods, paths, request shapes, response codes, and fields clients depend on. UI E2E tests often hit those APIs as a side effect—but without a contract lens you cannot tell:

Failure modeWhat goes wrongContract governance response
Happy-path blind spotsCheckout works; error enums, optional filters, and rare response codes never runField- and response-code coverage on each operation
Spec driftTraffic hits paths or fields the spec never declaredSpec defined vs observed / undocumented markers
Silent API debt“We have E2E” but whole services have zero covering testsOperations list with coverage scores and covering-test chips
Unowned gapsSomeone notices a hole; nothing is filed or authoredCreate issue, Create test, or Ignore gap from the gap itself

API contract governance is not a separate API testing product—it is the audit and triage layer that turns existing SmartTest traffic into accountable coverage of the contract.

How it works

  1. Discover the contract — Configure OpenAPI root path(s) from your connected repo. TestChimp parses the specs into services and operations.
  2. Observe traffic — Run SmartTests with TESTCHIMP_ENABLE_API_CAPTURE=1 (and @testchimp/playwright ≥ 0.2.17). Matching HTTP interactions are recorded and uploaded; coverage denormalization runs after batches (and on a periodic sweep).
  3. Measure coverage — The APIs list shows per-operation coverage score, latency, and covering tests. Drill into an operation for request/query/response schema field and response code coverage.
  4. Govern gaps — From an uncovered operation, field, or response code: file an issue, copy an agent prompt to create/update tests, or ignore the gap when it is intentional.

Open APIs from the main sidebar once OpenAPI roots are configured.

APIs operations list with coverage summary and endpoint table

What you get on the surfaces

SurfacePurpose
SetupOpenAPI roots, capture env, URL filters, payload storage
List viewService picker, coverage summary, searchable/filterable operations table, row-level gap actions
Detail viewPer-operation summary, covering tests, request/query/response schema trees, response-code panels, field-level governance

Governance actions (gaps)

Wherever coverage is missing, TestChimp offers the same decision set:

ActionWhen to use
Create issueTrack the gap as work—pre-filled title/description with method, path, operation id, and field or response code when applicable
Create testCopy an agent prompt scoped to the operation (or field / response code) for /testchimp create tests
Ignore gapAcknowledge the hole without filing work or authoring tests (intentional out-of-scope, deprecated surface, etc.)

Use these from the list (operation-level) or the detail page (field- and response-code-level). Details: list view and detail view.

How it fits the rest of TestChimp

  • SmartTests produce the traffic; the runtime plugin owns capture.
  • Issues receive gap filings via the same Create Issue flow used elsewhere.
  • Create tests workflows accept operation-id / field / response-code scopes from the copied prompts.
  • Release management remains the ship decision; API contract governance hardens what your automation proved against the API surface—not version sign-off itself.

Frequently asked questions

What is API contract governance in TestChimp?

API contract governance maps your OpenAPI operations to real and mocked SmartTest traffic so you can see endpoint and schema-field coverage, then triage gaps with create issue, create test, or ignore gap.

Do I need dedicated API tests?

No. Coverage is inferred from HTTP traffic your SmartTests already generate when API capture is enabled. You can still author dedicated API specs; the governance surface tracks both.

Why is my coverage empty after configuring OpenAPI?

Parsing the spec discovers operations, but scores and covering tests need runs with TESTCHIMP_ENABLE_API_CAPTURE=1 and a recent @testchimp/playwright. Capture is off by default.

What does Ignore gap do?

Ignore gap marks an uncovered operation, field, or response code as intentionally ungoverned for now—without creating an issue or a test—so teams can acknowledge debt without false urgency.

Where do Create test prompts go?

They open a copyable agent prompt scoped to the TestChimp operation id (and optional field or response code), meant for /testchimp create tests or an equivalent agent session.

Know the contract. Cover the edge cases.

Configure OpenAPI roots, enable API capture on SmartTest runs, and triage endpoint and field gaps from the APIs surface—before unaudited branches ship.

Start free on TestChimp · Book a demo