Skip to content

test: Pin date-time format precision tolerance#102

Merged
thced merged 1 commit into
masterfrom
fix/temporal-precision
Jun 2, 2026
Merged

test: Pin date-time format precision tolerance#102
thced merged 1 commit into
masterfrom
fix/temporal-precision

Conversation

@thced

@thced thced commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Java's OffsetDateTime/Instant/ZonedDateTime/LocalDateTime/LocalTime toString() omits seconds and fractional digits when zero, producing inconsistent serialised forms (e.g. "20:00Z" vs "20:00:00.123456Z"). Encode through a DateTimeFormatter that always writes six-digit (microsecond) fractional precision. Decoding remains permissive via each type's ISO parser.

The OpenAPI 'date-time' string format delegates to OffsetDateTime.parse,
which already accepts everything from second precision through nanosecond
precision (and either Z or numeric offset). Pin that behaviour so we can
keep emitting Java's natural toString() form on responses without fear of
clients sending higher-precision timestamps back to us.
@thced thced force-pushed the fix/temporal-precision branch from 06b60b9 to 3c9b3ed Compare June 2, 2026 06:15
@thced thced changed the title fix: Emit fixed microsecond precision for JSR-310 temporals test: Pin date-time format precision tolerance Jun 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@thced thced merged commit 48ec55d into master Jun 2, 2026
7 checks passed
@thced thced deleted the fix/temporal-precision branch June 2, 2026 09:41
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.

1 participant