Class ShadowApiFinder

java.lang.Object
com.arc_e_tect.gradle.shadow.detect.ShadowApiFinder

public class ShadowApiFinder extends Object
Determines which controller Endpoints are not described by any DescribedEndpoint collected from the OpenAPI documentation, i.e. which endpoints are "shadow APIs".

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

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new ShadowApiFinder.
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

    • ShadowApiFinder

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

    • findShadows

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

      An endpoint whose verb is HttpVerb.ANY (a Spring @RequestMapping that does not restrict its HTTP method) is considered described as soon as any verb is documented for a matching path.

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