Class MirageApiFinder

java.lang.Object
com.arc_e_tect.gradle.mirage.detect.MirageApiFinder

public class MirageApiFinder extends Object
Determines which DescribedEndpoints collected from the OpenAPI documentation have no matching controller Endpoint, i.e. which endpoints are "mirage APIs" - endpoints that are declared but never implemented.

Delegates to the shared ContractSetOperations.difference(List, List) in api-detector-core.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new MirageApiFinder.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint>
    findMirages(List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> described, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> endpoints)
    Returns every endpoint in described that has no matching entry in endpoints.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MirageApiFinder

      public MirageApiFinder()
      Creates a new MirageApiFinder.
  • Method Details

    • findMirages

      public List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> findMirages(List<com.arc_e_tect.gradle.detector.core.openapi.DescribedEndpoint> described, List<com.arc_e_tect.gradle.detector.core.model.Endpoint> endpoints)
      Returns every endpoint in described that has no matching entry in endpoints.

      A described endpoint is considered implemented as soon as a scanned controller endpoint matches its path and either matches its verb exactly or carries HttpVerb.ANY - a Spring @RequestMapping that does not restrict its HTTP method implements every verb documented for a matching path.

      Parameters:
      described - the endpoints described by the OpenAPI documentation
      endpoints - the endpoints found by scanning @RestController classes
      Returns:
      the described endpoints that are not implemented, in the order they were passed in