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 Classes
    Modifier and Type
    Interface
    Description
    static class 
    Fluent 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 Type
    Method
    Description
    Comma-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.
    boolean
    Whether SHAFT should summarize OpenAPI operation coverage at the end of execution.
    int
    Minimum OpenAPI operation coverage percentage required for a passing run.
    set()
    Returns a fluent API.SetProperty builder for programmatically overriding API properties.
    boolean
    Whether 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 at swaggerValidationUrl().

      Property key: swagger.validation.enabled — default: false

      Returns:
      true to enable Swagger validation; false to skip it
    • swaggerValidationUrl

      @Key("swagger.validation.url") @DefaultValue("") String swaggerValidationUrl()
      The URL of the Swagger/OpenAPI specification document used for response validation. Only relevant when swaggerValidationEnabled() returns true.

      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 against swaggerValidationUrl() and grouped by tag, path, and method.

      Property key: openapi.coverage.report.enabled - default: false

      Returns:
      true to enable OpenAPI coverage reporting; false to skip it
    • openApiCoverageThreshold

      @Key("openapi.coverage.threshold") @DefaultValue("0") int openApiCoverageThreshold()
      Minimum OpenAPI operation coverage percentage required for a passing run. A value of 0 disables threshold enforcement.

      Property key: openapi.coverage.threshold - default: 0

      Returns:
      required coverage percentage from 0 to 100
    • 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

      default API.SetProperty set()
      Returns a fluent API.SetProperty builder for programmatically overriding API properties.

      Example:

      SHAFT.Properties.api.set().swaggerValidationEnabled(true);
      
      Specified by:
      set in interface EngineProperties<API>
      Returns:
      a new API.SetProperty instance