You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In theory, golang behavior is correct, as in yaml, keys may not only be strings, but any object
However, as Jsonnet only allows strings as object keys, in Rust implementation I explicitly deserialize object keys as strings (thus skipping all of yaml magic), matching cjsonnet behavior (cjsonnet transforms rapidyaml output to json first, again deserializing object keys as strings), thus resulting in "on" key, instead of deserializing object key as anything (boolean in this case) and then coercing it to string (toString(true)).
Golang's behavior also brings problem with numbers: 0o11: 1 == "9": 1
...Including golang-specific (But implemented in jrsonnet) octals: google/jsonnet#1109 011: 1 == "9": 1
Even uglier problems with booleans: n: 1 == "false": 1
And note that null also fails: null: 1 == error
The solution for all of that is to not rely on yaml implementation in specific language, instead explicitly quote all the keys that might confuse the parser.
I noticed this on go-jsonnet but couldn't replicate with the C or rust version:
The text was updated successfully, but these errors were encountered: