google / google/jsonnet

Extending Strings with Dictionaries doesn't raise an error?

Open
#754 6 comments 0 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 just noticed that this works on the online `jsonnet.org` scratchpad:

**input.jsonnet**
```json
"hello world" {"key": "value"}
```
**output.json**
```json
"hello world{\"key\": \"value\"}"
```

In databricks/sjsonnet, this instead throws the following exception:

```text
sjsonnet.Error: Expected object, found string
at .(foo.jsonnet:1:15)
```

Presumably we should make google/jsonnet throw an exception as well? I don't really see any way this usage pattern is useful, so if it appears in code it seems very likely to be a programmer error

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.