Skip to content

Contract Coverage ​

--check verifies that every [RivetContract] field is actually implemented, and that the implementation matches the declaration:

bash
dotnet rivet --project path/to/Api.csproj --check

The checker finds .Success(...), .Error(...), and .File(...) terminal calls for each contract field, including terminals reached through .Bind(input), in controller actions, minimal API handlers (MapGet/MapPost/MapPut/ MapDelete/MapPatch lambdas), and isolated Azure Functions using [Function], [HttpTrigger], and .ToActionResult(). Functions coverage reads the project's host.json HTTP prefix (default api) and honors the host environment override. See Azure Functions for conventions and a real-host test. It reports four kinds of warning on stderr:

WarningMeaning
MissingImplementationNo contract response terminal found for the contract field.
OrphanedBindingThe contract was bound in a route handler, but no terminal result from that binding is returned.
HttpMethodMismatchThe implementing endpoint uses a different HTTP method than the contract declares.
RouteMismatchThe implementing endpoint's route does not match the contract's route template.

A summary line is always printed:

Coverage: 6/6 endpoints covered. All OK.

Exit code ​

When --check is used, any warning makes the command exit with code 1 — suitable for CI, both with and without --output: coverage runs before emission, so a failed check prints the warnings and writes nothing even when an output directory is requested. Combine with -q/--quiet to suppress generation output in CI logs.