Abbreviated bool values are not parsed as Boolean

Issue #447 invalid
Basil Peace created an issue

According to https://yaml.org/type/bool.html, boolean

\> may be abbreviated as a single character “y”/“n” or “Y”/“N

However, this doesn’t work.

import org.yaml.snakeyaml.Yaml

String x = '''\
b: y
'''.stripIndent()
Yaml yaml = new Yaml()
m = yaml.load(x)
println m['b'].class

gives java.lang.String, not Boolean.

SnakeYAML version: 1.23

JDK 8u191

Comments (3)

  1. Basil Peace reporter
    • edited description

    According to https://yaml.org/type/bool.html, boolean

    may be abbreviated as a single character “y”/“n” or “Y”/“N

    However, this doesn’t work.

    import org.yaml.snakeyaml.Yaml
    

    gives java.lang.String, not Boolean.

    SnakeYAML version: 1.23

    JDK 8u191

  2. Log in to comment