YAMLの真偽値の扱いに注意。


実はYAMLには型があります。

a: 123                     # an integer
b: "123"                   # a string, disambiguated by quotes
c: 123.0                   # a float
d: !!float 123             # also a float via explicit data type prefixed by (!!)
e: !!str 123               # a string, disambiguated by explicit type
f: !!str Yes               # a string via explicit type
g: Yes                     # a boolean True
h: Yes we have No bananas  # a string, "Yes" and "No" disambiguated by context.

123や"123"をinteger, stringと扱うのは普段Ruby等を使用されている方は見慣れてると思いますが、
Yesは boolean の扱いをされる点に注目。(Objective-Cな人は見慣れてますかね)

それが何か問題になるの?

YAMLパーサーの中にはキーにYes(yesも)を利用すると、"true": という様に キー名を変換してしまう パーサーもあるので、命名に注意しないといけません。

こんな感じで