shorthand for deep field overrides
Open
enhancement
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
``` jsonnet
local foo = {
a: { b: { c: { d: 1234 } } },
e: 1
};
foo + { a.b.c.d: 999 }
```
It would be really cool if the above (or something along those lines) worked and evaluated to:
``` jsonnet
{
a: { b: { c: { d: 999 } } },
e: 1
}
```
To achieve the same in today's jsonnet you would have to write:
``` jsonnet
local foo = {
a: { b: { c: { d: 1234 } } },
e: 1
};
foo + { a+: { b+: { c+: { d: 9999} }
```
I don't know how difficult and/or sane this would be to implement, but there is a similar construct in Nix that is quite useful :)
Contributor guide
Assessment
This issue has not been assessed yet.