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
Describe the bug
When exporting string valued fields to YAML, the exporter optimistically omits quoting, e.g. { foo = "bar" } exports to
foo: bar
When such a string could be interpreted as a sexagesimal number in YAML 1.1, i.e. { foo = "00:00" }, this produces the export
foo: 00:00
which, according to YAML 1.1, is parsed as a record with a single field foo with value the integer 0. This becomes an issue when interacting with, for example, libyaml based parsers, as other people have observed already.
For maximum interoperability it might be best to unconditionally quote strings. A workaround in the meantime is to use that YAML is supposed to be a superset of JSON and to use the JSON exporter instead. But this leads to less idiomatic configuration outputs in places.
Additional context
Since nickel really just piggy backs on serde_yaml as its exporter, this might be something that can only be addresses upstream.
The text was updated successfully, but these errors were encountered:
Describe the bug
When exporting string valued fields to YAML, the exporter optimistically omits quoting, e.g.
{ foo = "bar" }
exports toWhen such a string could be interpreted as a sexagesimal number in YAML 1.1, i.e.
{ foo = "00:00" }
, this produces the exportwhich, according to YAML 1.1, is parsed as a record with a single field
foo
with value the integer 0. This becomes an issue when interacting with, for example,libyaml
based parsers, as other people have observed already.For maximum interoperability it might be best to unconditionally quote strings. A workaround in the meantime is to use that YAML is supposed to be a superset of JSON and to use the JSON exporter instead. But this leads to less idiomatic configuration outputs in places.
Additional context
Since
nickel
really just piggy backs onserde_yaml
as its exporter, this might be something that can only be addresses upstream.The text was updated successfully, but these errors were encountered: