Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure the "norway problem" doesn't exist in the YAML parser #7

Open
luxas opened this issue Aug 30, 2021 · 0 comments
Open

Ensure the "norway problem" doesn't exist in the YAML parser #7

luxas opened this issue Aug 30, 2021 · 0 comments

Comments

@luxas
Copy link
Owner

luxas commented Aug 30, 2021

The "norway problem" was popularized from blog posts like https://hitchdev.com/strictyaml/why/implicit-typing-removed/

In YAML 1.1 there is an "implicit typing" feature that converts no, yes, YES, NO etc. literals to true or false:

For example, the boolean “true” might also be written as “yes”.

See the attached slides for a practical example of how unintuitive this is

image
image

This is luckily fixed in YAML 1.2:

We have removed unique implicit typing rules and have updated these rules to align them with JSON's productions. In this version of YAML, boolean values may be serialized as “true” or “false”; the empty scalar as “null”.

yaml.v2 is supporting YAML 1.1, but yaml.v3 implements YAML 1.2; hence we should use yaml.v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant