Class ApiOnlySuiteExtension
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.file.ConfigurableFileCollectionDirectories to search recursively for@RestControllerclasses, shared by all three underlying detector plugins (Doppelganger API Detector's separatetestDirsis not covered here, since it has no equivalent in the other two plugins).abstract org.gradle.api.file.ConfigurableFileCollectionExternal 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, whentrue, forwards as a fallback convention to all three underlying plugins' own fail-on-gap property -shadowApiDetector.failOnShadow,mirageApiDetector.failOnMirage, anddoppelgangerApiDetector.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.RegularFilePropertyThe root OpenAPI document shared by all three underlying detector plugins.
-
Field Details
-
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 ownrootDocumentproperty; 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@RestControllerclasses, shared by all three underlying detector plugins (Doppelganger API Detector's separatetestDirsis not covered here, since it has no equivalent in the other two plugins). Forwarded as a fallback to each plugin's owncontrollerDirsproperty; 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
Convenience switch that, whentrue, forwards as a fallback convention to all three underlying plugins' own fail-on-gap property -shadowApiDetector.failOnShadow,mirageApiDetector.failOnMirage, anddoppelgangerApiDetector.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 tofalse, 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()andgetControllerDirs(). This property has no effect ondetectAllApiGapsitself: that aggregate task's own dedicated task instances always force their fail-on-gap property tofalse, by design, regardless of this setting or any individual plugin's own configuration - seeApiOnlySuitePlugin's class-level documentation.- Returns:
- mutable boolean property controlling the fallback fail-on-gap value for all three underlying plugins
-
getExcludePaths
Exclusion rule strings, shared by all three underlying detector plugins. Forwarded as a fallback to each plugin's ownexcludePathsproperty, following the same "eager empty-check" idiomgetControllerDirs()already uses (notProperty#convention, which has no equivalent for list-valued properties): when a plugin's ownexcludePathsis still empty at configuration time, this list is forwarded into it wholesale; a plugin that configures its ownexcludePathsdirectly 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 ownexcludeFilesproperty, using the same eager empty-check idiom asgetExcludePaths()andgetControllerDirs().- Returns:
- mutable file collection of exclusion rule files, shared by all three plugins
-
getExcludeWellKnown
Names of bundled, well-known exclusion sets, shared by all three underlying detector plugins. Forwarded as a fallback to each plugin's ownexcludeWellKnownproperty, using the same eager empty-check idiom asgetExcludePaths().- Returns:
- mutable list property of well-known exclusion set names, shared by all three plugins
-