Skip to content

fix: Refactor ConvertDocumentResponse for polymorphic deserialization based on docling-serve API response#388

Open
ArpanKrChakraborty wants to merge 1 commit intodocling-project:mainfrom
ArpanKrChakraborty:feature/convert-api
Open

fix: Refactor ConvertDocumentResponse for polymorphic deserialization based on docling-serve API response#388
ArpanKrChakraborty wants to merge 1 commit intodocling-project:mainfrom
ArpanKrChakraborty:feature/convert-api

Conversation

@ArpanKrChakraborty
Copy link

fix: Refactor ConvertDocumentResponse for polymorphic deserialization (#206)

Refactored ConvertDocumentResponse into a sealed abstract base class with
three concrete implementations (InBodyConvertDocumentResponse,
PreSignedUrlConvertDocumentResponse, ZipArchiveConvertDocumentResponse)
to properly handle different response types from Docling Serve API.

  • Use Jackson @JsonTypeInfo with DEDUCTION for automatic type detection of JSON-based responses
  • Leverage Java 17 sealed classes for type safety
  • Update reference implementation in docling-serve-client to handle these new types
  • Add comprehensive test coverage for all response types
  • Update documentation and Javadoc

Fixes #206

@ArpanKrChakraborty ArpanKrChakraborty force-pushed the feature/convert-api branch 2 times, most recently from e971bc7 to a5ea31c Compare March 9, 2026 08:51
@edeandrea
Copy link
Contributor

Hi @ArpanKrChakraborty sorry for the delay in getting to this - I've been out of the office for 2 weeks and I'm still catching up. I will get to this!

@github-actions
Copy link

:java_duke: JaCoCo coverage report

Overall Project 46.96% 🔴

There is no coverage information present for the Files changed

@github-actions
Copy link

TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)996 ran996 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions
Copy link

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

• Download: Artifacts for this run

…docling-project#206)

Refactored ConvertDocumentResponse into a sealed abstract base class with
three concrete implementations (InBodyConvertDocumentResponse,
PreSignedUrlConvertDocumentResponse, ZipArchiveConvertDocumentResponse)
to properly handle different response types from Docling Serve API.

- Use Jackson @JsonTypeInfo with DEDUCTION for automatic type detection of JSON-based responses
- Leverage Java 17 sealed classes for type safety
- Update reference implementation in docling-serve-client to handle these new types
- Add comprehensive test coverage for all response types
- Update documentation and Javadoc
- Apply Spotless

Fixes docling-project#206

Signed-off-by: Arpan Chakraborty <arpan.chakraborty1908@gmail.com>
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.

image_export_mode=referenced returns image paths, but image files are missing

2 participants