Replies: 1 comment 5 replies
-
I am aware that 1.2 disabled recursive priorities with #1600, this is more of a discussion about setting a priority for a given field at runtime using a function such as |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am trying to merge two records from two separate yaml sources:
and another variant to override it:
Running
nickel export merge.ncl
on the file above gives the output below::Note that only record fields found in
force.yaml
are returned, this makes sense given the currency behaviour of&
since the| default
is applied to thevalue
record field.I would like to return:
And do so by applying priorities recursively at runtime to the records found in
base_yaml
.Since the SOT for the two records are found outside a nickel file, I cannot directly apply a priority to the fields without redundantly redefining each value, what would be the most ergonomic approach to give me the right recursive behaviour?
Ideally I'd like something akin to
let yaml_base = (import "base.yaml" | default) in
or any other way to recursively apply apriority
.Something akin to
std.record.map_field_priority
would be a great way to apply a merge priority in a functional manner:base_yaml |> std.record.map_field_priority (fun _key _value => -1)
Beta Was this translation helpful? Give feedback.
All reactions