Class OpenApiCoverageReporter

java.lang.Object
com.shaft.capture.generate.api.internal.OpenApiCoverageReporter

public final class OpenApiCoverageReporter extends Object
Cross-reports the endpoints recorded in an API capture session against the operations declared by a provided OpenAPI (2.0/3.x) spec, in either JSON or YAML. Read-only and deterministic -- this never mutates the spec or the recording, and never requires AI: it is a set comparison between METHOD normalized-path pairs, where a normalized path replaces every recorded path segment that looks like an identifier (numeric, or a UUID) with an OpenAPI-style {param} placeholder so that e.g. GET /orders/42 matches a declared GET /orders/{orderId} operation.
  • Method Details

    • report

      public static OpenApiCoverageReporter.CoverageReport report(Path specPath, List<ApiTransaction> transactions)
      Loads an OpenAPI spec (JSON or YAML, detected by file extension, falling back to content-sniffing) and reports coverage against the recorded transactions.
      Parameters:
      specPath - path to the OpenAPI spec file
      transactions - recorded, renderable API transactions
      Returns:
      deterministic coverage report; OpenApiCoverageReporter.CoverageReport.loadable() is false and every other field is empty when the spec could not be read or parsed