Skip to content
Commitwise
Menu

@ConfigurationProperties

Also called: Typed configuration

A Spring Boot class (often a record or data class) that binds a group of settings to typed, validated fields at startup.

Definition

Annotated with a prefix such as payment, the class receives every payment.* setting from application.yml, profiles, environment variables and other sources, converted to types like Duration, URI or enums. With @Validated, missing or invalid values stop the app at startup instead of failing later. It replaces scattered @Value strings and is easy to construct in tests.

In practice

PaymentProperties(baseUrl, timeout, retry) is injected into the payment client; PAYMENT_TIMEOUT=3s overrides the file.

Related terms

Esc

Type to search the whole site.