Comment by foobiekr
6 years ago
YAML has tons of warts like this.
https://yaml.org/type/bool.html
This should be used in schools as an example to illustrate how not to do things.
6 years ago
YAML has tons of warts like this.
https://yaml.org/type/bool.html
This should be used in schools as an example to illustrate how not to do things.
Also as an example of "always deserialize to known types". Flexible boolean values can be convenient since it's relatively human-readable, but "deserialize into [whatever the heck you think is appropriate]" is a problem for quite a few reasons beyond confusion: https://lgtm.com/blog/swagger_snakeyaml_CVE-2017-1000207_CVE... (same techniques have been used against other kinds of serialization in many languages for many years)
Every feature is a source of bugs. Be careful when constructing end user affordances for systems that have broad applicability and need to run over a very long time span.