Skip to content

shorthand for deep field overrides #227

Open
@benley

Description

@benley
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:

{
  a: { b: { c: { d: 999 } } },
  e: 1
}

To achieve the same in today's jsonnet you would have to write:

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 :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions