Class ApiOnlySuiteExtension

java.lang.Object
com.arc_e_tect.gradle.suite.ApiOnlySuiteExtension

public abstract class ApiOnlySuiteExtension extends Object
DSL extension for the Arc-E-Tect API-Only Suite Gradle plugin.

This is a thin convenience extension, not a full proxy for the three underlying detector plugins: it exposes only the settings that are almost always identical across all three in practice - getRootDocument(), getControllerDirs(), and getFailOnDetection(). Any setting not exposed here must be configured directly on the individual plugin's own extension block (shadowApiDetector { }, mirageApiDetector { }, doppelgangerApiDetector { }).

Every property configured here is forwarded to all three underlying extensions as a fallback convention, applied only where a consumer has not already configured that property directly on the individual extension. An explicit per-plugin value always wins over a value configured here, regardless of the order the two are configured in the build script.

 apiOnlySuite {
     rootDocument = file('src/main/resources/openapi/openapi.yaml')
     controllerDirs.from('src/main/java')
     failOnDetection = true

     excludePaths.add('/actuator/health')
     excludeFiles.from('exclusions.yaml')
     excludeWellKnown.add('spring-boot-actuator')
 }
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Extension DSL block name, i.e.
  • Constructor Summary

    Constructors
    Constructor
    Description
    For use by the Gradle-generated concrete subclass.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.ConfigurableFileCollection
    Directories to search recursively for @RestController classes, shared by all three underlying detector plugins (Doppelganger API Detector's separate testDirs is not covered here, since it has no equivalent in the other two plugins).
    abstract org.gradle.api.file.ConfigurableFileCollection
    External exclusion rule files, shared by all three underlying detector plugins.
    abstract org.gradle.api.provider.ListProperty<String>
    Exclusion rule strings, shared by all three underlying detector plugins.
    abstract org.gradle.api.provider.ListProperty<String>
    Names of bundled, well-known exclusion sets, shared by all three underlying detector plugins.
    abstract org.gradle.api.provider.Property<Boolean>
    Convenience switch that, when true, forwards as a fallback convention to all three underlying plugins' own fail-on-gap property - shadowApiDetector.failOnShadow, mirageApiDetector.failOnMirage, and doppelgangerApiDetector.failOnDoppelganger - so a consumer who wants every detector to fail the build on a genuine finding doesn't need to repeat that intent three times.
    abstract org.gradle.api.file.RegularFileProperty
    The root OpenAPI document shared by all three underlying detector plugins.

    Methods inherited from class java.lang.Object

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

    • NAME

      public static final String NAME
      Extension DSL block name, i.e. the name used to register the extension with the project.
      See Also:
  • Constructor Details

    • ApiOnlySuiteExtension

      public ApiOnlySuiteExtension()
      For use by the Gradle-generated concrete subclass.
  • Method Details

    • getRootDocument

      public abstract org.gradle.api.file.RegularFileProperty getRootDocument()
      The root OpenAPI document shared by all three underlying detector plugins. Forwarded as a fallback convention to each plugin's own rootDocument property; a value set directly on an individual plugin's own extension always takes precedence over this one.
      Returns:
      mutable file property for the shared root OpenAPI document
    • getControllerDirs

      public abstract org.gradle.api.file.ConfigurableFileCollection getControllerDirs()
      Directories to search recursively for @RestController classes, shared by all three underlying detector plugins (Doppelganger API Detector's separate testDirs is not covered here, since it has no equivalent in the other two plugins). Forwarded as a fallback to each plugin's own controllerDirs property; directories configured directly on an individual plugin's own extension always take precedence over this one.
      Returns:
      mutable file collection of shared controller source directories
    • getFailOnDetection

      public abstract org.gradle.api.provider.Property<Boolean> getFailOnDetection()
      Convenience switch that, when true, forwards as a fallback convention to all three underlying plugins' own fail-on-gap property - shadowApiDetector.failOnShadow, mirageApiDetector.failOnMirage, and doppelgangerApiDetector.failOnDoppelganger - so a consumer who wants every detector to fail the build on a genuine finding doesn't need to repeat that intent three times. Defaults to false, matching every individual plugin's own default.

      A fail-on-gap value set directly on an individual plugin's own extension always takes precedence over this one, regardless of the order the two are configured in the build script - exactly like getRootDocument() and getControllerDirs(). This property has no effect on detectAllApiGaps itself: that aggregate task's own dedicated task instances always force their fail-on-gap property to false, by design, regardless of this setting or any individual plugin's own configuration - see ApiOnlySuitePlugin's class-level documentation.

      Returns:
      mutable boolean property controlling the fallback fail-on-gap value for all three underlying plugins
    • getExcludePaths

      public abstract org.gradle.api.provider.ListProperty<String> getExcludePaths()
      Exclusion rule strings, shared by all three underlying detector plugins. Forwarded as a fallback to each plugin's own excludePaths property, following the same "eager empty-check" idiom getControllerDirs() already uses (not Property#convention, which has no equivalent for list-valued properties): when a plugin's own excludePaths is still empty at configuration time, this list is forwarded into it wholesale; a plugin that configures its own excludePaths directly keeps exactly that list instead, with nothing forwarded from here.
      Returns:
      mutable list property of exclusion rule strings, shared by all three plugins
    • getExcludeFiles

      public abstract org.gradle.api.file.ConfigurableFileCollection getExcludeFiles()
      External exclusion rule files, shared by all three underlying detector plugins. Forwarded as a fallback to each plugin's own excludeFiles property, using the same eager empty-check idiom as getExcludePaths() and getControllerDirs().
      Returns:
      mutable file collection of exclusion rule files, shared by all three plugins
    • getExcludeWellKnown

      public abstract org.gradle.api.provider.ListProperty<String> getExcludeWellKnown()
      Names of bundled, well-known exclusion sets, shared by all three underlying detector plugins. Forwarded as a fallback to each plugin's own excludeWellKnown property, using the same eager empty-check idiom as getExcludePaths().
      Returns:
      mutable list property of well-known exclusion set names, shared by all three plugins