Skip to content

GROOVY-12012: groovy-yaml: clarify when dates can retain rich types v…#2533

Merged
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12012
May 15, 2026
Merged

GROOVY-12012: groovy-yaml: clarify when dates can retain rich types v…#2533
paulk-asert merged 1 commit into
apache:masterfrom
paulk-asert:groovy12012

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

…s when handled as Strings

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.1391%. Comparing base (94ae84d) to head (11c31bd).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2533        +/-   ##
==================================================
- Coverage     68.1437%   68.1391%   -0.0046%     
+ Complexity      32755      32754         -1     
==================================================
  Files            1499       1499                
  Lines          125228     125232         +4     
  Branches        22604      22604                
==================================================
- Hits            85335      85332         -3     
- Misses          32381      32385         +4     
- Partials         7512       7515         +3     
Files with missing lines Coverage Δ
...vy-yaml/src/main/java/groovy/yaml/YamlBuilder.java 77.7778% <100.0000%> (ø)
...vy-yaml/src/main/java/groovy/yaml/YamlSlurper.java 80.9524% <100.0000%> (+4.4818%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app
Copy link
Copy Markdown

testlens-app Bot commented May 15, 2026

✅ All tests passed ✅

🏷️ Commit: 968497f
▶️ Tests: 85184 executed
⚪️ Checks: 28/28 completed


Learn more about TestLens at testlens.app.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the groovy-yaml module documentation and tests to clarify how temporal values are represented in untyped vs typed parsing, and improves typed Jackson databinding support for java.time.* types.

Changes:

  • Document that untyped YamlSlurper.parse/parseText returns YAML date/time scalars as String, and explain why.
  • Add spec tests covering typed round-trip of OffsetDateTime/LocalDate/LocalTime and pin untyped string behavior.
  • Configure the Jackson ObjectMapper used by typed parsing and YamlBuilder.toYaml to register JavaTimeModule and adjust date/time features.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
subprojects/groovy-yaml/src/spec/test/groovy/yaml/YamlParserTest.groovy Adds temporal round-trip tests for typed parsing and asserts untyped parsing returns strings for temporal-looking scalars.
subprojects/groovy-yaml/src/spec/doc/yaml-userguide.adoc Updates the type mapping table and adds notes/section describing untyped vs typed temporal handling and examples.
subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlSlurper.java Introduces a shared Jackson ObjectMapper factory registering JavaTimeModule and disabling specific date/time features for typed parsing.
subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlBuilder.java Reuses YamlSlurper.mapper(...) so typed YAML writing gains the same java.time configuration.
subprojects/groovy-yaml/build.gradle Adds jackson-datatype-jsr310 to support java.time serialization/deserialization.

Comment thread subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlSlurper.java
Comment thread subprojects/groovy-yaml/src/spec/doc/yaml-userguide.adoc
@sonarqubecloud
Copy link
Copy Markdown

@paulk-asert paulk-asert merged commit b6174a8 into apache:master May 15, 2026
31 checks passed
@paulk-asert paulk-asert deleted the groovy12012 branch May 15, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants