GROOVY-12012: groovy-yaml: clarify when dates can retain rich types v…#2533
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 968497f Learn more about TestLens at testlens.app. |
There was a problem hiding this comment.
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/parseTextreturns YAML date/time scalars asString, and explain why. - Add spec tests covering typed round-trip of
OffsetDateTime/LocalDate/LocalTimeand pin untyped string behavior. - Configure the Jackson
ObjectMapperused by typed parsing andYamlBuilder.toYamlto registerJavaTimeModuleand 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. |
…s when handled as Strings
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



…s when handled as Strings