-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make #ref from parent work inside #include file #92
Comments
This seems like a confusing feature. What's the use case? |
I'm not sure about OP but I'm using aero to define data structures that will resemble pages in a website. I have some default properties in my root edn file, which also uses #include to pull in the separate edn files for each page. |
The use case is close the one described in the README @SevereOverfl0w : If you take that example and move (spit "secrets.edn"
(pr-str {:aws-test-key "TEST_KEY"
:aws-prod-key "TEST_KEY"}))
(spit "config.edn"
"{:secrets #include \"secrets.edn\"
:aws #include \"aws.edn\"}")
(spit "aws.edn"
"{:aws-secret-access-key #ref [:secrets :aws-test-key]}")
(aero/read-config
"config.edn"
{:profile "unused"})
;; =>
{:secrets {:aws-test-key "TEST_KEY", :aws-prod-key "TEST_KEY"},
:aws {:aws-secret-access-key nil}}
|
Would a shared secrets.edn work for your just case? Both config.edn and aws.edn would include it? |
Yes, there are several options that work right now:
I just thought it would be less surprising if EDIT: changing this in |
At the moment #include works by reading the config on the file:
aero/src/aero/core.cljc
Line 86 in 1749e71
This breaks #ref that are in another file "higher" up in the include hierarchy, ex:
Without knowing too much about aero's internals, it seems a possible solution would be to include
.edn
files without resolving the tags at the'include
level.The text was updated successfully, but these errors were encountered: