Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Strings that are commonly interpreted as booleans by other YAML parsers are not escaped #380

Open
Whodiduexpect opened this issue Jul 9, 2023 · 0 comments

Comments

@Whodiduexpect
Copy link

Serde-yaml creates ambiguous YAML during the serialization of keys with string values that could be considered boolean in YAML 1.1. For instance, serializing foo with the string value no results in foo: no. Many YAML 1.2 parsers would still interpret no as boolean due to continued support for 1.1 booleans. I ran into this issue using Python's yaml module:

>>> import yaml
>>> data = yaml.safe_load("foo: no")
>>> print(data)
{'foo': False}

To avoid YAML created from serde-yaml being misinterpreted by many YAML parsers, string values that may be seen as booleans should be quoted or otherwise disambiguated from YAML 1.1 boolean values.

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

No branches or pull requests

1 participant