google / google/jsonnet

Shorthand for specifying objects with keys and values from current scope

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

Description

I find myself having to frequently write things like:
```
{foo: foo, bar: bar, baz: baz}
```
ie. an object that takes some local variable, and includes it under the same name.

I'd like to propose a sugar for this which does `{foo}` -> `{foo: foo}`.
ie. the above example would become `{foo, bar, baz}`.

This is similar in spirit to `jq`'s syntax for this, where `{foo}` -> `{foo: .foo}`.

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.