jsonnet
jsonnet copied to clipboard
std.parseYaml() fails to parse 3 digits versions
Simplest way to reproduce :
$ jsonnet -e "std.parseYaml('version: 1.2.3')"
Something went wrong during jsonnet_evaluate_snippet, please report this: [json.exception.parse_error.101] parse error at line 1, column 16: syntax error while parsing object - invalid literal; last read: '1.2.'; expected '}'
[1] 443873 IOT instruction (core dumped) jsonnet -e "std.parseYaml('version: 1.2.3')"
It seems to be parsing a float instead of a string.
This was fixed in rapidyaml a few days ago : https://github.com/biojppm/rapidyaml/pull/299
I guess go-jsonnet would work fine, as it uses a different YAML parser.
We should bump the rapidyaml version here.
Hi, is there any plan to update rapidyaml version in jsonnet to address the issue? Not sure why this issue wasn't fixed in the v0.20.0 cycle.
I'm upgrading Rapid YAML in #1134 - I'll confirm this works then.
Should work on master now. I have added a test case for it (https://github.com/google/jsonnet/pull/1135). Thanks for the bug report!