google / google/jsonnet

Shorthand for "pattern matching" on an object parameter

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

Description

One thing I really miss when writing jsonnet after writing Nix for a while is the ability to deconstruct an object being passed in as a parameter. For example:

``` nix
{ a, b, c }: a + b + c
```

is a one-parameter lambda (arguably the only sort that matters!) that expects the caller to pass it a dict with those three keys in it. You can also set defaults and match on the aggregate.

Would it be possible to get something similar in jsonnet?

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.