google / google/jsonnet

Keyword that returns most recently nested field.

Open
#437 0 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Jsonnet
Stars
7.6k
Forks
475
PR merge metrics
No merged PRs in 30d

Description

edit: Completely rewrote the example as it was nonsense...

```
local Template(name) = { name: name };

{
local outer = self,
path: [],
f: Template(here) {
local outer2 = self,
path: outer.path + [self.name],
g: Template(here) {
local outer3 = self,
path: outer2.path + [self.name],
},
},
}
```

yields

```
{
"f": {
"g": {
"name": "g",
"path": [
"f",
"g"
]
},
"name": "f",
"path": [
"f"
]
},
"path": [ ]
}
```

@andreabedini expressed interest in this feature

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.