0

constants_config.yaml

site:  fb
another_site: google

my_config.yaml

my_site: ${constants_config.yaml]

Resulting my_config.yaml

my_site: fb

I just want to get a single constant, not the whole constants_config.yaml (which is done by using default)

1 Answers1

1

Not possible directly. You can do it with interpolation into a constants node. Something like:

constants.yaml:

constants:
  site:  fb
  another_site: google

main.yaml:

defaults:
  - constants

my_site: ${constants.site}

The composed config should look something like:

constants:
  site:  fb
  another_site: google

my_site: ${constants.site}
Omry Yadan
  • 31,280
  • 18
  • 64
  • 87