Skip to content

ISSUE #27923 - fixed shadowing datetime serialization from jackson#27925

Open
TeddyCr wants to merge 2 commits intoopen-metadata:mainfrom
TeddyCr:ISSUE-27923
Open

ISSUE #27923 - fixed shadowing datetime serialization from jackson#27925
TeddyCr wants to merge 2 commits intoopen-metadata:mainfrom
TeddyCr:ISSUE-27923

Conversation

@TeddyCr
Copy link
Copy Markdown
Collaborator

@TeddyCr TeddyCr commented May 6, 2026

Describe your changes:

Fixes #27923

Summary

  • Configure Dropwizard's ObjectMapper to serialize java.util.Date fields as ISO 8601 strings instead of epoch millisecond timestamps
  • Aligns REST API response serialization with the JSON Schema definitions and swagger spec

Problem

The application has two ObjectMapper instances:

  1. JsonUtils.OBJECT_MAPPER — used for DB reads/writes and internal operations. Configured with WRITE_DATES_AS_TIMESTAMPS = false and a SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'").
  2. Dropwizard's bootstrap ObjectMapper — used by JAX-RS to serialize all @produces(APPLICATION_JSON) responses. Uses Jackson defaults, where WRITE_DATES_AS_TIMESTAMPS = true.

This means all 18 java.util.Date fields across 15 generated classes (e.g., AirflowConfig.startDate,
Pipeline.startDate, DataContract.effectiveFrom, TagLabel.appliedAt) are stored as ISO 8601 strings in the DB but serialized as epoch millis in REST responses — contradicting the swagger spec which declares them as "format": "date-time".

Fix

Set WRITE_DATES_AS_TIMESTAMPS = false and reuse JsonUtils.DATE_TIME_FORMAT on Dropwizard's
ObjectMapper

Test plan

  • Verify AirflowConfig.startDate/endDate are returned as ISO 8601 strings in GET
    /v1/services/ingestionPipelines responses
  • Verify Pipeline.startDate/endDate serialization in GET /v1/pipelines

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Bug fix

  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

Summary by Gitar

  • Refined JSON serialization:
    • Updated JsonPatchProvider to disable WRITE_DATES_AS_TIMESTAMPS and set DATE_TIME_FORMAT to ensure consistent date handling across JSON patches.

This will update automatically on new commits.

Copilot AI review requested due to automatic review settings May 6, 2026 00:19
@TeddyCr TeddyCr changed the title ISSUE #27923 ISSUE #27923 - fixed shadowing datetime serialization from jackson May 6, 2026
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels May 6, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 6, 2026

Code Review ✅ Approved

Configures Dropwizard's ObjectMapper to serialize date fields as ISO 8601 strings to match JSON schema specifications. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

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

Align REST JSON date serialization with the schema/swagger contract by trying to make server-side Jackson emit java.util.Date values as ISO-8601 strings instead of epoch millis. This sits in the service bootstrap/Jersey layer that controls API response encoding.

Changes:

  • Configure Dropwizard’s bootstrap ObjectMapper to disable timestamp serialization and use JsonUtils.DATE_TIME_FORMAT.
  • Apply the same date serialization settings to JsonPatchProvider.
  • Keep date formatting consistent with the existing internal JsonUtils mapper configuration.

Reviewed changes

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

File Description
openmetadata-service/src/main/java/org/openmetadata/service/OpenMetadataApplication.java Updates the bootstrap Jackson mapper used during service initialization.
openmetadata-service/src/main/java/org/openmetadata/service/JsonPatchProvider.java Updates the Jersey ContextResolver<ObjectMapper> used by the JSON Patch provider.

Comment on lines +771 to +774
bootstrap
.getObjectMapper()
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.setDateFormat(JsonUtils.DATE_TIME_FORMAT);
Comment on lines +771 to +774
bootstrap
.getObjectMapper()
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
.setDateFormat(JsonUtils.DATE_TIME_FORMAT);
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🔴 Playwright Results — 2 failure(s), 9 flaky

✅ 3992 passed · ❌ 2 failed · 🟡 9 flaky · ⏭️ 87 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🔴 Shard 2 743 1 6 8
✅ Shard 3 755 0 0 7
🟡 Shard 4 774 0 1 18
✅ Shard 5 687 0 0 41
🔴 Shard 6 734 1 2 9

Genuine Failures (failed on all attempts)

Features/Container.spec.ts › Container page children pagination (shard 2)
�[31mTest timeout of 180000ms exceeded.�[39m
Features/AutoPilot.spec.ts › Create Service and check the AutoPilot status (shard 6)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: getByText('AutoPilot agents run completed successfully.')
Expected: visible
Timeout: 60000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 60000ms�[22m
�[2m  - waiting for getByText('AutoPilot agents run completed successfully.')�[22m

🟡 9 flaky test(s) (passed on retry)
  • Features/ActivityAPI.spec.ts › Activity event shows the actor who made the change (shard 2, 1 retry)
  • Features/ActivityAPI.spec.ts › Activity Feed widget displays feed items (shard 2, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataProductPersonaCustomization.spec.ts › Data Product - customize tab label should only render if it's customized by user (shard 2, 1 retry)
  • Features/DataQuality/BundleSuiteBulkOperations.spec.ts › Add test case to existing Bundle Suite (shard 2, 1 retry)
  • Features/Glossary/GlossaryWorkflow.spec.ts › should display correct status badge color and icon (shard 2, 2 retries)
  • Pages/CustomProperties.spec.ts › Should clear search and show all properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Users.spec.ts › Create and Delete user (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backward-Incompatible-Change Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go SDK ingestionPipelines Patch fails with JSON timestamp parse error

3 participants