jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incorrect boolean conversion from json to yaml.

JamesKyburz opened this issue · comments

ᐅ echo "{\"hello\": \"yes\"}" | json2yaml -
hello: yes

The yaml needs to quote boolean keywords when the json contains them as strings.

yes is not a boolean keyword anymore in Yaml 1.2 spec so yes is perfectly valid and equivalent to 'yes' and thus doesn't need to be quoted.

@jeremyfa ok thanks didn't know that. I guess the docker-compose tools I am using aren't using yaml spec 1.2 then :)