Comments (7)
It's because the reference.conf is resolved by itself, the relevant spec text is:
The reference config for a given class loader should be merged and resolved first, and may be shared among all application configs in that class loader. Substitutions in the reference config are not affected by any application configs, because the reference config should be resolved by itself.
The application config should then be loaded, have the reference config added as a fallback, and have substitutions resolved. This means the application config can refer to the reference config in its substitutions.
from config.
This also tripped me up. Is there a way to get an unresolved reference config so I can merge them myself?
from config.
Sure you can always just use parseResources("reference.conf")
and other building-block operations to replicate ConfigFactory.load()
. The load
methods are just a sort of canned, standard way to do things but you could do your own thing (with extra work).
from config.
For the record. This has bitten me as well.
from config.
I don't think there's much to do here that would be 1) backward compatible and 2) not just move the "gotcha" to a different scenario, but of course open to suggestions. It certainly is possible to construct your own way of doing things that works differently, using the library.
from config.
Fully agree: the current behavior allows sane sharing of defaultConfig()
, which is a worthy goal.
For reference, hereβs the solution developed in this thread: https://gist.github.com/4233706
from config.
If this is a common need and we want to "standardize" a solution such as dynamic.conf I'm certainly willing to discuss that feature request, but I guess I'll close this for now since I'm not familiar with the use case and don't have immediate action planned. The original report was describing the currently-designed behavior.
from config.
Related Issues (20)
- Find a StackOverflowError in config
- Find a StackOverflowError in config
- Find a StackOverflowError in config HOT 1
- underscore characters HOT 2
- Problems with com.typesafe/config and maven-dependency-plugin
- introduce method accepting a list of Objects to add a value
- Should this project be explicitly considered as deprecated/not supported? HOT 29
- Community fork? HOT 7
- Resolving Variable Substitutions Between Multiple Config HOT 1
- Something error when use com.typesafe.config API convert conf file to scala bean class
- withFallBack is not adding value if not present
- how to load the config with substitution details HOT 3
- Add info about which signing keys will be used for published artifacts.
- Cannot provide environment variables programmatically
- Rendering partially resolved appended array results in invalid configuration HOT 1
- Inconsistent behavior with Overflow/Underflow and Exceptions
- Regression in environment variable reading behavior HOT 2
- Add a module info HOT 6
- Question about `ConfigFactory.systemProperties()` on windows HOT 1
- When rendering unresolved ConfigConcatenation, whitespaces are erroneously included
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from config.