Interface API
- All Superinterfaces:
org.aeonbits.owner.Config, EngineProperties<API>, Serializable
@Sources({"system:properties","file:src/main/resources/properties/api.properties","file:src/main/resources/properties/default/api.properties","classpath:api.properties"})
public interface API
extends EngineProperties<API>
Configuration properties interface for API (REST) testing in the SHAFT framework.
Covers Swagger/OpenAPI schema validation settings that are applied when performing
REST API requests via
SHAFT.API.
Use set() to override values programmatically:
SHAFT.Properties.api.set().swaggerValidationEnabled(true).swaggerValidationUrl("https://petstore.swagger.io/v2/swagger.json");
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent builder that allows programmatic override of individual API configuration properties.Nested classes/interfaces inherited from interface org.aeonbits.owner.Config
org.aeonbits.owner.Config.ConverterClass, org.aeonbits.owner.Config.DecryptorClass, org.aeonbits.owner.Config.DefaultValue, org.aeonbits.owner.Config.DisableableFeature, org.aeonbits.owner.Config.DisableFeature, org.aeonbits.owner.Config.EncryptedValue, org.aeonbits.owner.Config.HotReload, org.aeonbits.owner.Config.HotReloadType, org.aeonbits.owner.Config.Key, org.aeonbits.owner.Config.LoadPolicy, org.aeonbits.owner.Config.LoadType, org.aeonbits.owner.Config.PreprocessorClasses, org.aeonbits.owner.Config.Separator, org.aeonbits.owner.Config.Sources, org.aeonbits.owner.Config.TokenizerClass -
Method Summary
Modifier and TypeMethodDescriptionComma-separated request, response, header, query, or JSON body keys redacted in HTTP contracts.Comma-separated request, response, header, query, or JSON body keys normalized in HTTP contracts.booleanWhether SHAFT should summarize OpenAPI operation coverage at the end of execution.intMinimum OpenAPI operation coverage percentage required for a passing run.default API.SetPropertyset()Returns a fluentAPI.SetPropertybuilder for programmatically overriding API properties.booleanWhether automatic Swagger/OpenAPI response-schema validation is enabled for all API calls.The URL of the Swagger/OpenAPI specification document used for response validation.
-
Method Details
-
swaggerValidationEnabled
@Key("swagger.validation.enabled") @DefaultValue("false") boolean swaggerValidationEnabled()Whether automatic Swagger/OpenAPI response-schema validation is enabled for all API calls. When enabled, each response is validated against the schema defined atswaggerValidationUrl().Property key:
swagger.validation.enabled— default:false- Returns:
trueto enable Swagger validation;falseto skip it
-
swaggerValidationUrl
The URL of the Swagger/OpenAPI specification document used for response validation. Only relevant whenswaggerValidationEnabled()returnstrue.Property key:
swagger.validation.url— default:""- Returns:
- the Swagger spec URL, or an empty string if not configured
-
openApiCoverageReportEnabled
@Key("openapi.coverage.report.enabled") @DefaultValue("false") boolean openApiCoverageReportEnabled()Whether SHAFT should summarize OpenAPI operation coverage at the end of execution. When enabled, API calls are matched againstswaggerValidationUrl()and grouped by tag, path, and method.Property key:
openapi.coverage.report.enabled- default:false- Returns:
trueto enable OpenAPI coverage reporting;falseto skip it
-
openApiCoverageThreshold
@Key("openapi.coverage.threshold") @DefaultValue("0") int openApiCoverageThreshold()Minimum OpenAPI operation coverage percentage required for a passing run. A value of0disables threshold enforcement.Property key:
openapi.coverage.threshold- default:0- Returns:
- required coverage percentage from
0to100
-
contractSensitiveKeys
@Key("shaft.contract.sensitiveKeys") @DefaultValue("authorization,cookie,set-cookie,password,passwd,secret,token,api-key,apikey,access-key,accesskey") String contractSensitiveKeys()Comma-separated request, response, header, query, or JSON body keys redacted in HTTP contracts.Property key:
shaft.contract.sensitiveKeys- Returns:
- configured sensitive key fragments
-
contractVolatileKeys
@Key("shaft.contract.volatileKeys") @DefaultValue("requestId,traceId,spanId,sessionId,nonce,timestamp,createdAt,updatedAt,expiresAt,date,etag") String contractVolatileKeys()Comma-separated request, response, header, query, or JSON body keys normalized in HTTP contracts.Property key:
shaft.contract.volatileKeys- Returns:
- configured volatile key names
-
set
Returns a fluentAPI.SetPropertybuilder for programmatically overriding API properties.Example:
SHAFT.Properties.api.set().swaggerValidationEnabled(true);- Specified by:
setin interfaceEngineProperties<API>- Returns:
- a new
API.SetPropertyinstance
-