Skip to content

feat(api): add PresignedUrlTarget and PreSignedUrlConvertResponse#543

Merged
edeandrea merged 1 commit into
docling-project:mainfrom
edeandrea:feat/presigned-url-target-response
Jun 15, 2026
Merged

feat(api): add PresignedUrlTarget and PreSignedUrlConvertResponse#543
edeandrea merged 1 commit into
docling-project:mainfrom
edeandrea:feat/presigned-url-target-response

Conversation

@edeandrea

@edeandrea edeandrea commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add PresignedUrlTarget request target and PreSignedUrlConvertResponse response type for the presigned-URL delivery mode introduced in docling-serve v1.22.0
  • Add supporting types: DocumentArtifactItem, ArtifactRef, ArtifactType, ConversionStatus, ProfilingItem, ProfilingScope
  • Add custom Instant serializers/deserializers for Jackson 2 and 3 (following the existing Duration serializer pattern)
  • Add numPartiallySucceeded field to PreSignedUrlConvertDocumentResponse to align with current OpenAPI spec
  • Update ConvertOperations to treat PresignedUrlTarget as a remote target
  • Replace @JsonTypeInfo(DEDUCTION) + @JsonSubTypes on ConvertDocumentResponse with explicit custom deserializers (Jackson2ConvertDocumentResponseDeserializer / Jackson3ConvertDocumentResponseDeserializer) that dispatch based on distinguishing JSON fields and fail fast on unknown shapes
  • Upgrade default Testcontainers image from v1.19.0 to v1.24.0
  • Add WireMock functional tests verifying full request serialization and response deserialization round-trips
  • Update documentation across serve-api.md, serve-client.md, getting-started.md, README.md, and whats-new.md

Acknowledgments

This PR builds on the foundation laid by @dan-m62 in #535 and #537. Their work on PresignedUrlTarget, PreSignedUrlConvertResponse, and the supporting model types (DocumentArtifactItem, ArtifactRef, ArtifactType, ConversionStatus, ProfilingItem, ProfilingScope) provided the starting point for this implementation. This PR addresses the review feedback on those PRs (functional WireMock tests, polymorphic deserialization, Instant handling, client routing, docs) and consolidates the changes into a single PR.

Supersedes #535 and #537.

Closes #541

Test plan

  • ./gradlew --no-daemon build passes (all modules)
  • ./gradlew --no-daemon spotlessCheck passes
  • API model tests pass (PresignedUrlTargetTests, ArtifactRefTests, DocumentArtifactItemTests, ConvertDocumentResponseTests)
  • WireMock functional tests verify PresignedUrlTarget request serialization and PreSignedUrlConvertResponse deserialization (single and multiple documents)
  • Existing Testcontainers tests pass with upgraded v1.24.0 image
  • Existing PUT/S3 target tests pass with the new custom deserializer (no DEDUCTION ambiguity)

Copilot AI review requested due to automatic review settings June 15, 2026 18:04
@edeandrea edeandrea force-pushed the feat/presigned-url-target-response branch from d3a8af1 to adb917f Compare June 15, 2026 18:06
@edeandrea edeandrea enabled auto-merge (squash) June 15, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the docling-serve-api / docling-serve-client surface to support docling-serve’s server-managed presigned-URL delivery mode (v1.22.0+), adding the request target (PresignedUrlTarget), the corresponding response shape (PreSignedUrlConvertResponse with per-document artifacts), plus supporting model types and Jackson Instant codecs. It also updates client routing, bumps the default Testcontainers image, and expands docs/tests to cover the new round-trip behavior.

Changes:

  • Add PresignedUrlTarget and PreSignedUrlConvertResponse (+ supporting response model types) and wire them into polymorphic (DEDuction-based) response handling.
  • Add Jackson 2 & 3 Instant serializers/deserializers and use them for presigned artifact expiry timestamps and profiling timestamps.
  • Update client conversion routing, integration tests (WireMock), and documentation; bump the default docling-serve container image to v1.24.0.

Reviewed changes

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

Show a summary per file
File Description
README.md Documents the new PRE_SIGNED_URL_RESPONSE response type in the usage snippet.
docs/src/doc/docs/whats-new.md Adds release notes entries for the presigned URL target/response and supporting types (but currently has a duplicated version heading).
docs/src/doc/docs/getting-started.md Updates example switch to include PRE_SIGNED_URL_RESPONSE.
docs/src/doc/docs/docling-serve/serve-client.md Adds target snippet and an end-to-end example for handling PreSignedUrlConvertResponse.
docs/src/doc/docs/docling-serve/serve-api.md Documents the new target, response type, and adds a presigned URL example.
docling-testcontainers/src/main/java/ai/docling/testcontainers/serve/config/DoclingServeContainerConfig.java Bumps default docling-serve image version to v1.24.0.
docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java Adds WireMock functional tests for PresignedUrlTarget request serialization + PreSignedUrlConvertResponse deserialization (single and multiple documents).
docling-serve/docling-serve-client/src/main/java/ai/docling/serve/client/operations/ConvertOperations.java Treats PresignedUrlTarget as a “remote target” so multi-source requests return JSON rather than ZIP streaming.
docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/DocumentArtifactItemTests.java Adds unit tests for the new DocumentArtifactItem model.
docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/ConvertDocumentResponseTests.java Adds unit tests for the new PreSignedUrlConvertResponse subtype behavior and defaults.
docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/response/ArtifactRefTests.java Adds unit tests for ArtifactRef (including nullable expiry).
docling-serve/docling-serve-api/src/test/java/ai/docling/serve/api/convert/request/target/PresignedUrlTargetTests.java Adds a basic round-trip test for PresignedUrlTarget.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/serialization/Jackson3InstantSerializer.java Adds Jackson 3 Instant serializer used by new response models.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/serialization/Jackson3InstantDeserializer.java Adds Jackson 3 Instant deserializer used by new response models.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/serialization/Jackson2InstantSerializer.java Adds Jackson 2 Instant serializer used by new response models.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/serialization/Jackson2InstantDeserializer.java Adds Jackson 2 Instant deserializer used by new response models.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ResponseType.java Adds PRE_SIGNED_URL_RESPONSE enum constant and updates Javadoc for presigned-related response types.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ProfilingScope.java Adds profiling scope enum used by new profiling model.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ProfilingItem.java Adds profiling item model, including Instant list timestamp handling.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/PreSignedUrlConvertResponse.java Adds the new per-document presigned URL response subtype.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/PreSignedUrlConvertDocumentResponse.java Adds numPartiallySucceeded to align with OpenAPI spec.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/DocumentArtifactItem.java Adds per-source conversion outcome + artifacts container.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ConvertDocumentResponse.java Adds PreSignedUrlConvertResponse subtype and sets defaultImpl for DEDUCTION deserialization.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ConversionStatus.java Adds conversion status enum for per-document outcomes.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ArtifactType.java Adds artifact type enum for presigned artifacts.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/response/ArtifactRef.java Adds artifact reference model including presigned URL expiry timestamp.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/target/Target.java Permits and registers PresignedUrlTarget subtype and kind discriminator.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/target/PresignedUrlTarget.java Adds the new marker target type for server-managed presigned URL delivery.

Comment thread docs/src/doc/docs/whats-new.md
@edeandrea edeandrea disabled auto-merge June 15, 2026 18:14
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

:java_duke: JaCoCo coverage report

Overall Project 47.47% 🔴

There is no coverage information present for the Files changed

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)1436 ran1436 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Copilot AI review requested due to automatic review settings June 15, 2026 18:23
@edeandrea edeandrea enabled auto-merge (squash) June 15, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread docs/src/doc/docs/whats-new.md
Comment thread docs/src/doc/docs/docling-serve/serve-client.md
Copilot AI review requested due to automatic review settings June 15, 2026 18:31
@edeandrea edeandrea disabled auto-merge June 15, 2026 18:35
@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI review requested due to automatic review settings June 15, 2026 18:38
@edeandrea edeandrea force-pushed the feat/presigned-url-target-response branch from 5dc3472 to 587b4e9 Compare June 15, 2026 18:38
Add support for the presigned-URL delivery mode introduced in
docling-serve v1.22.0. Clients can now request
`{"target": {"kind": "presigned_url"}}` and receive per-document
artifact download URLs in a `PreSignedUrlConvertResponse`.

New request target:
- `PresignedUrlTarget` — marker class in the `Target` sealed hierarchy

New response types:
- `PreSignedUrlConvertResponse` — extends `ConvertDocumentResponse`
  with a `documents` list and aggregate conversion stats
- `DocumentArtifactItem` — per-document result with status and artifacts
- `ArtifactRef` — presigned download URL with expiry timestamp
- Supporting enums: `ArtifactType`, `ConversionStatus`,
  `ProfilingScope`
- Supporting type: `ProfilingItem` for per-stage timing data

Additional changes:
- Custom `Instant` serializers/deserializers for Jackson 2 and 3,
  following the existing `Duration` serializer pattern
- Custom `ConvertDocumentResponse` deserializers for Jackson 2 and 3
  that dispatch based on distinguishing JSON fields and fail fast on
  unknown shapes (replaces `@JsonTypeInfo(DEDUCTION)`)
- `PreSignedUrlConvertDocumentResponse` gains `numPartiallySucceeded`
  field to align with the current OpenAPI spec
- `ConvertOperations` treats `PresignedUrlTarget` as a remote target
- Default Testcontainers image upgraded from v1.19.0 to v1.24.0
- WireMock functional tests verify full request/response round-trip
- Documentation updated across all relevant files

This work builds on the foundation laid by @dan-m62 in docling-project#535 and docling-project#537.

Closes docling-project#541

Assisted-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
@edeandrea edeandrea force-pushed the feat/presigned-url-target-response branch from 587b4e9 to 27bc818 Compare June 15, 2026 18:39
@edeandrea edeandrea enabled auto-merge (squash) June 15, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread README.md
Comment thread docs/src/doc/docs/getting-started.md
@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@edeandrea edeandrea disabled auto-merge June 15, 2026 19:02
@edeandrea edeandrea merged commit e58bb2e into docling-project:main Jun 15, 2026
25 of 26 checks passed
@edeandrea edeandrea deleted the feat/presigned-url-target-response branch June 15, 2026 19:03
@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

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.

Support PresignedUrlTarget request target and PresignedUrlConvertResponse response format

2 participants