Skip to content

Preserve SQL Timestamp nanoseconds in JSON - #1501

Merged
1 commit merged into
javers:masterfrom
PHJ2000:fix-timestamp-nanoseconds
Oct 12, 2026
Merged

1 commit merged into
javers:masterfrom
PHJ2000:fix-timestamp-nanoseconds

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Serialize SQL timestamps via toLocalDateTime() so their nanoseconds survive JSON round trips. The existing deserializer already supports this precision.

Adds Spock coverage for nanoseconds, pre-epoch values, and millisecond-only compatibility. Validation uses JDK 17 and UTC; the existing date assertions depend on the default time zone, and an unrelated hierarchy test expects pre-JDK-21 collection interfaces.

Validation: TZ=UTC ./gradlew :javers-core:check — 1,509 tests passed (JDK 17, TZ=UTC).

Fixes #1500.

@bartoszwalacik bartoszwalacik closed this pull request by merging all changes into javers:master in a5192af Oct 12, 2026
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.

JSON round trip truncates java.sql.Timestamp nanoseconds

2 participants