google / google/go-jsonnet

feature request - key of object within parent object

Open
#355 14 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
1.8k
Forks
263
PR merge metrics
No merged PRs in 30d

Description

I've found myself often doing things that require the key of the object I'm currently in. Here's an example:

```jsonnet
top: {
myThing: {
name: "myThing" // this is the key of the current object with "top"
}
}
```

desired:

```jsonnet
top: {
myThing: {
name: keyOf(self, $)
}
}
```

I have no idea if this is reasonably possible, or maybe there's a better way to go about doing this?

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.