Class DoppelgangerApiFinder
@RestController method, but have no matching verification evidence from any configured
ContractVerificationSource - i.e. which endpoints are "doppelganger APIs".
This does not delegate to api-detector-core's
ContractSetOperations.difference(...), even though both sides are List<Endpoint>:
SpringCloudContractScanner produces genuinely
concrete, resolved paths (e.g. "/items/1", taken from a contract's own example request),
not templates - unlike the paths ControllerScanner, OpenApiEndpointCollector,
RestDocsScanner, and
OpenApiRequestValidatorScanner all produce, which
are always templates. ContractSetOperations' shared matching requires both sides to be
templates with aligned placeholders, so it would never recognise a Spring Cloud Contract example
for "/items/{id}" as verifying it. This class instead matches candidates against verified
entries directly via PathMatcher.matchesConcrete(String, String), which accepts a
concrete path on one side and a template on the other - the comparison Prompt 3 anticipated
wouldn't always "line up cleanly" through the shared generic operation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<com.arc_e_tect.gradle.detector.core.model.Endpoint> findDoppelgangers(List<com.arc_e_tect.gradle.detector.core.model.Endpoint> declaredAndImplemented, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> verified) Returns every endpoint indeclaredAndImplementedthat has no matching entry inverified.
-
Constructor Details
-
DoppelgangerApiFinder
public DoppelgangerApiFinder()Creates a newDoppelgangerApiFinder.
-
-
Method Details
-
findDoppelgangers
public List<com.arc_e_tect.gradle.detector.core.model.Endpoint> findDoppelgangers(List<com.arc_e_tect.gradle.detector.core.model.Endpoint> declaredAndImplemented, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> verified) Returns every endpoint indeclaredAndImplementedthat has no matching entry inverified.- Parameters:
declaredAndImplemented- endpoints both declared in the OpenAPI documentation and implemented by a@RestControllermethodverified- endpoints with verification evidence from any enabledContractVerificationSource- Returns:
- the endpoints with no verification evidence, in the order they were passed in
-