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