Class OpenApiCoverageCollector
Collects OpenAPI coverage from REST responses and shape matches: the route matcher resolves each hit
to a contract path, the typed ledger counts it, and the report builder renders the contract's
endpoints, responses and properties whether or not they were hit. A source that is a path on the
application (/openapi/v1.json) with no address to resolve it against loads from the application
once the run's infrastructure started, so an in-process application documents itself.
public sealed class OpenApiCoverageCollector : ProtoCoverageCollector, IProtoCollector, IProtoReportSource, IProtoRunHook
- Inheritance
-
OpenApiCoverageCollector
- Implements
- Inherited Members
- Extension Methods
Constructors
OpenApiCoverageCollector(string, IConfiguration, IEnumerable<ProtoApplicationTarget>)
public OpenApiCoverageCollector(string targetName, IConfiguration configuration, IEnumerable<ProtoApplicationTarget> applicationTargets)
Parameters
targetNamestringconfigurationIConfigurationapplicationTargetsIEnumerable<ProtoApplicationTarget>
OpenApiCoverageCollector(string, string)
public OpenApiCoverageCollector(string targetName, string openApiSpecSource)
Parameters
Properties
Category
public override string Category { get; }
Property Value
Methods
CanCollect(ProtoObservation)
Determines whether this collector accepts an observation.
public override bool CanCollect(ProtoObservation observation)
Parameters
observationProtoObservation
Returns
Collect(ProtoObservation)
Records an incoming observation. Implementations should support concurrent calls when tests or requests execute in parallel.
public override void Collect(ProtoObservation observation)
Parameters
observationProtoObservation
GetReportItems()
public override IEnumerable<ProtoReportItem> GetReportItems()