Git Product home page Git Product logo

Comments (7)

havocp avatar havocp commented on August 18, 2024

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.

geoff-addepar avatar geoff-addepar commented on August 18, 2024

This also tripped me up. Is there a way to get an unresolved reference config so I can merge them myself?

from config.

havocp avatar havocp commented on August 18, 2024

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.

bigtoast avatar bigtoast commented on August 18, 2024

For the record. This has bitten me as well.

from config.

havocp avatar havocp commented on August 18, 2024

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.

rkuhn avatar rkuhn commented on August 18, 2024

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.

havocp avatar havocp commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.