feat(api): add PresignedUrlTarget for v1.22 S3 delivery#535
Closed
dan-m62 wants to merge 1 commit into
Closed
Conversation
docling-serve v1.22.0 introduces a server-managed presigned-URL delivery
mode: the operator configures DOCLING_SERVE_ARTIFACT_STORAGE_* settings,
clients request `{"target": {"kind": "presigned_url"}}`, and the server
uploads each output artifact to its own bucket and returns time-limited
presigned GET URLs in the response.
The response side of this surface (PreSignedUrlConvertDocumentResponse)
landed in docling-project#388 but the request side was not added at the same time.
Because `Target` is sealed, downstream users cannot supply their own
subtype — they either bypass the SDK to hand-build the request JSON, or
fork.
This commit closes the gap by adding PresignedUrlTarget as a permitted
subtype of Target, mirroring the existing trivial-marker pattern used
by InBodyTarget and ZipTarget:
- PresignedUrlTarget.java: empty marker with the standard builder
- Target.java: extend permits (alphabetical), @JsonSubTypes, and Kind
enum with the `presigned_url` discriminator
- PresignedUrlTargetTests.java: builder + Target-subtype + toBuilder
roundtrip assertions, matching the test scope of the other target
tests in this module
Signed-off-by: Daniel Imber <dimber@m62.ai>
8b4803b to
bc12443
Compare
Contributor
|
Hi @dan-m62 thank you for this! Something I noticed - the
|
Contributor
|
This is 1/2 the implementation of #541 |
Contributor
|
@all-contributors add @dan-m62 for code, idea |
Contributor
|
I've put up a pull request to add @dan-m62! 🎉 |
6 tasks
Contributor
edeandrea
added a commit
to edeandrea/docling-java
that referenced
this pull request
Jun 15, 2026
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
- `PreSignedUrlConvertDocumentResponse` gains `numPartiallySucceeded`
field to align with the current OpenAPI spec
- `ConvertOperations` treats `PresignedUrlTarget` as a remote target
- `ConvertDocumentResponse` uses `defaultImpl` for Jackson DEDUCTION
to resolve ambiguity with `PreSignedUrlConvertDocumentResponse`
- 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
added a commit
to edeandrea/docling-java
that referenced
this pull request
Jun 15, 2026
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
added a commit
to edeandrea/docling-java
that referenced
this pull request
Jun 15, 2026
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
added a commit
that referenced
this pull request
Jun 15, 2026
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 #535 and #537.
Closes #541
Assisted-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
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.
docling-servev1.22.0+ introduces a server-managed presigned-URL delivery mode: the operator configuresDOCLING_SERVE_ARTIFACT_STORAGE_*settings, clients request{"target": {"kind": "presigned_url"}}, and the server uploads each output artifact to its own bucket and returns time-limited presigned GET URLs in the response.The response side of this surface (
PreSignedUrlConvertDocumentResponse) exists via #388 but the request side was not added at the same time. BecauseTargetis sealed, downstream users cannot supply their own subtype — they either bypass the SDK to hand-build the request JSON, or fork.This commit adds
PresignedUrlTargetas a permitted subtype of Target, mirroring the existing trivial-marker pattern used byInBodyTargetandZipTargeti.e.:presigned_urldiscriminator