Hi all,

PR #2949 (https://github.com/apache/groovy/pull/2949) moves groovy-yaml, 
groovy-toml and groovy-csv to Jackson 3. Paul asked that one consequence be 
raised here rather than land quietly.

Jackson 3's YAML parser resolves unquoted values by the JSON schema, and the 
resolver can't be configured. Only lowercase true, false and null and plain 
decimal numbers take a type. yes/no/on/off, True/FALSE, Null, ~ and 0x1F/017 
now arrive as strings, where Groovy 6 read them as booleans, null or integers.

The case most likely to bite: "enabled: off" read with YamlSlurper.parseText 
now gives the String 'off', which is truthy, with no error. The typed 
parseAs/parseTextAs API rejects it for a boolean property instead.

The PR documents this as a 7.0 breaking change and has a test that pins it. The 
YAML guide shows how to load with SnakeYAML directly for documents that need 
YAML 1.1 typing. Comments welcome, especially if anyone thinks it shouldn't 
ship as is.

Scott

Reply via email to