Closed maxatome closed 4 years ago
YAML::PP is using the YAML 1.2 Core schema as a default.
For a comparison: https://perlpunk.github.io/YAML-PP-p5/schemas.html
In YAML 1.1, no
was resolved as a boolean, but not anymore in YAML 1.2.
You can use the 1.1 schema explicitly: https://metacpan.org/pod/YAML::PP::Schema::YAML1_1
But 3x
doesn't need quotes in any of the schemas.
Hope that helps :)
Btw, if you simply want to preserve the quoting style from loading, you can use:
YAML::PP->new( preserve => PRESERVE_SCALAR_STYLE );
See the preserve
option here: https://metacpan.org/pod/YAML::PP#new
It's still experimental though and might not work correctly for all styles.
Hi, Sorry for the delay. I missed the YAML 1.1 vs 1.2 differences. I have to check on decoder side (not YAML::PP one) why I encountered a problem with "3x". Sorry for the noise @perlpunk and thanks!
Hello,
"no" and "3x" should be quoted in resulting YAML as "true" is. Perhaps am I missing something?