Skip to content

Conversation

@rob-bygrave
Copy link
Contributor

@rob-bygrave rob-bygrave commented Dec 8, 2025

Changes the behaviour to match Spring such that properties loaded have their values overridden by System properties (if exist) and then by Environment variables (if exist).

Similarly, the fallback values used when a no entry was loaded via a properties source will also first lookup System properties and then Environment variables [which matches the existing behaviour of avaje-config, no change to the fallback value case].

andponlin and others added 13 commits December 5, 2025 21:14
- rename ConfigurationFallbacks to ConfigurationFallback
- Change List<ConfigurationFallbacks> fallbacks to single ConfigurationFallback fallback
- Make DefaultFallback final
- Rename method Configuration.Builder.withFallbacks() to fallback()
- add overrideValue() method
- Invoke overrideValue() on initial load and builder load
This allows us to override the source along with the value.
A downside is that we need to expose more methods on the
Entry interface that were otherwise internal to CoreEntry.
Rather than nullable, and thus allow the source to also be provided by
the fallback method.
@rob-bygrave rob-bygrave requested a review from SentryMan December 8, 2025 22:46
@rob-bygrave rob-bygrave changed the title Default values match spring Behaviour change - match Spring for overriding and fallback values Dec 8, 2025
@rbygrave rbygrave self-assigned this Dec 9, 2025
@rbygrave rbygrave added this to the 5.0 milestone Dec 9, 2025
@rbygrave rbygrave merged commit 7777162 into master Dec 9, 2025
11 checks passed
@rbygrave rbygrave deleted the default-values-match-spring branch December 9, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants