[ 
https://issues.apache.org/jira/browse/GROOVY-12433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134435#comment-18134435
 ] 

ASF GitHub Bot commented on GROOVY-12433:
-----------------------------------------

codeconsole commented on PR #2949:
URL: https://github.com/apache/groovy/pull/2949#issuecomment-6506921438

   Thanks, Daniel. On treating the breaks as first-class migration items 
(points 3 and 5):
   
   - **`COMPATIBILITY.md`** (b6d43bc) now has a "Groovy 7 — groovy-yaml, 
groovy-toml and groovy-csv use Jackson 3 (GROOVY-12433)" section beside the 
other Groovy 7 entries. It lists each change with who is affected and what to 
do: YAML scalar resolution, Jackson 2 databind annotations, typed XML following 
the classpath, Jackson 2 and SnakeYAML no longer transitive, and parser limits. 
It also says what stays the same.
   - **The PR description's breaking changes** point to that section and now 
include the parser limits as well. The YAML, TOML, CSV and XML guides keep 
their notes beside typed parsing, and `YamlScalarResolutionTest` pins the 
scalar behaviour.
   
   On the limits (point 4), I measured both versions to get the wording right. 
YAML and TOML input deeper than 500 levels now fails, where Jackson 2 allowed 
1000. The string-length increase only matters for TOML: neither version 
length-checks CSV fields, and both cap a YAML document at 3,145,728 code 
points. The PR description says so now.
   
   On the scalar change, thanks for weighing in on the [dev@ 
thread](https://lists.apache.org/thread.html/t5nf7xk17wvf1dbol40ock8thg771rz3). 
Jochen's point that this isn't YAML 1.2 core either is in the wording: the 
guide and `COMPATIBILITY.md` both say the resolver is the JSON schema, stricter 
than the core schema, and name the values that change.
   
   I've also merged master again. It merged cleanly, and the yaml, toml, csv, 
xml (including `jackson2Test`) and json tests pass.
   




> Move groovy-yaml, groovy-toml and groovy-csv to Jackson 3
> ---------------------------------------------------------
>
>                 Key: GROOVY-12433
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12433
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-csv, groovy-toml, groovy-yaml, XML Processing
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>             Fix For: 7.0.0-alpha-1
>
>
> groovy-yaml, groovy-toml and groovy-csv are built on Jackson 2 
> ({{com.fasterxml.jackson}} 2.22.x). Spring Boot 4 uses Jackson 3 
> ({{tools.jackson}}) by default, so an application on Spring Boot 4 that uses 
> one of these modules carries both major versions and has to manage the 
> Jackson 2 one itself. Jackson 2 and 3 use different packages and coordinates, 
> so having Jackson 3 on the classpath does nothing for these modules.
> None of the three modules exposes a Jackson type in its public API, so they 
> can move to Jackson 3 without source changes for callers.
> Proposal:
> * Depend on {{tools.jackson}} 3.1.6, the version Spring Boot 4.2 manages. 
> {{jackson-datatype-jsr310}} is no longer needed; java.time support is built 
> into Jackson 3 databind.
> * Build every mapper with {{configureForJackson2()}} so databinding keeps 
> Jackson 2's defaults: properties in declaration order, unknown properties 
> rejected, nulls for primitives and trailing tokens accepted. The CSV mapper 
> also keeps {{SORT_PROPERTIES_ALPHABETICALLY}}, which Jackson 2's 
> {{CsvMapper}} enabled itself and the user guide documents.
> * Parser limits follow Jackson 3's defaults: nesting depth 500 (was 1000) and 
> string length 100,000,000 (was 20,000,000). Jackson lowered the depth after 
> fuzzers reached a StackOverflowError below 1000 (FasterXML/jackson-core#1233) 
> and raised the string length for legitimate large payloads 
> (FasterXML/jackson-core#1538). {{JsonSlurper}} and {{XmlParser}} keep their 
> 1000-level caps.
> * {{XmlParser.parseAs}} and {{parseTextAs}} load jackson-databind 
> reflectively; use Jackson 3 when present and fall back to Jackson 2.
> * Jackson 3's YAML backend uses SnakeYAML Engine rather than SnakeYAML, so 
> the SnakeYAML alias recipe from GROOVY-12358 needs {{org.yaml:snakeyaml}} 
> declared explicitly, as the user guide already anticipates.
> Jackson 3 still uses {{com.fasterxml.jackson.annotation}}, so 
> {{@JsonProperty}}, {{@JsonFormat}} and the other annotations in user code 
> keep working.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to