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
    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
    • 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