google / google/jsonnet

default null syntax

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

Description

Motivation: when `?.` is means we can call `select` on a `nullable` value, but it still throws `Field does not exists` exception.

What about using a `obj.b?` or `obj['b'?] syntax to express: if `b` does not exists in `obj` , then return `null` instead of an error.

- obj.b?
- obj["b"?]

or, we can just use `std.get` method

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.