configuration-properties

Featured

Use when introducing or correcting grouped Spring Boot configuration, typed property binding, validation, profiles or secret injection. Do not rewrite unrelated single-value configuration.

AI & Automation 260 stars 40 forks Updated 4 days ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
80
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Configuration Properties ## Spring Boot 4 baseline The examples use Java 17 and Jakarta APIs supported by this Boot version. Keep dependencies managed by the project's Boot BOM. ## Bind and validate Inspect existing property prefixes and external deployment configuration before renaming keys. Use a typed ConfigurationProperties record for a related group of settings. Register it with EnableConfigurationProperties or ConfigurationPropertiesScan; a record is not automatically a bean. Use Validated and Jakarta constraints, and include spring-boot-starter-validation. Validate nested objects with Valid. A single record constructor needs no ConstructorBinding annotation. Use explicit units for durations and sizes. Provide defaults only when they are operationally safe; missing credentials or required endpoints should fail startup. Do not assume NotNull rejects zero or negative Duration values; add a duration constraint or an explicit invariant. [ClientProperties](examples/ClientProperties.java) and [its configuration](examples/good-client.yml) show a validated prefix with explicit duration units. Do not turn a full API token into a record component: generated toString can expose secrets. Resolve secrets at the integration boundary or use a redacting value type. ## Deployment and overrides Document the public property keys and validate actual environment-variable binding in a test. Use environment variables or a mounted secret/config tree according to the deployment platfo...

Details

Author
rrezartprebreza
Repository
rrezartprebreza/spring-boot-skills
Created
4 months ago
Last Updated
4 days ago
Language
Java
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category