docling-java icon indicating copy to clipboard operation
docling-java copied to clipboard

`furniture` field missing from `DoclingDocument` JSON serialized via docling-java

Open mohammedfaisal opened this issue 8 months ago • 1 comments

Summary

When converting a PDF to a DoclingDocument using docling-java, the resulting JSON is missing the mandatory furniture field as defined in the DoclingDocument schema. This makes the document non-compliant with the schema and breaks downstream processing — for example, converting the document to Markdown fails because the furniture root node is absent.

Environment

  • docling-java version: 0.4.7
  • docling-serve version: v1.14.3
  • Input file: https://dserver.bundestag.de/brd/2024/0266-24B.pdf

Steps to Reproduce

  1. Use docling-java to convert a PDF via the ConvertDocumentRequest API with OutputFormat.JSON and includeImages(false).
  2. Retrieve the DoclingDocument from response.getDocument().getJsonContent().
  3. Serialize the DoclingDocument to JSON using Jackson ObjectMapper.
  4. Observe that the furniture field is absent from the output JSON.

Expected Behavior

The serialized JSON should include the furniture field, as it is a mandatory part of the DoclingDocument schema. When converting the same PDF using the docling-serve web UI (backed by the same docling-serve instance), the furniture field is correctly present:

"furniture": {
  "self_ref": "#/furniture",
  "parent": null,
  "children": [],
  "content_layer": "furniture",
  "meta": null,
  "name": "_root_",
  "label": "unspecified"
}

Actual Behavior

The JSON produced by docling-java is missing the furniture field entirely. The document starts directly with body after origin:

{
  "schema_name": "DoclingDocument",
  "version": "1.9.0",
  "name": "4085-original",
  "origin": { ... },
  "body": { ... }
  // ← no "furniture" field
}

Please the diff of DoclingDocuments generated via docling-serve web UI and docling-java in the screenshot attached.

Image

mohammedfaisal avatar Mar 06 '26 11:03 mohammedfaisal

This is a confirmed bug in docling-java — the furniture field is not implemented in the DoclingDocument class.

What's happening:

  1. docling-serve correctly includes furniture in its JSON response (using Python's docling-core schema)
  2. docling-java's DoclingDocument class has no furniture field defined
  3. Jackson is configured with FAIL_ON_UNKNOWN_PROPERTIES = false, so the field is silently dropped during deserialization

Interestingly, the ContentLayer.FURNITURE enum value exists, suggesting partial implementation — but the top-level collection field was never added. This appears to be an oversight given docling-java's goal of comprehensively mirroring the Python schema.

Workaround: If you need furniture immediately, parse the raw JSON response from docling-serve before deserialization, or extract the field separately.

This should be straightforward to fix by adding a GroupItem furniture field to DoclingDocument with the appropriate default value.

To reply, just mention @dosu.


Share context across your team and agents. Try Dosu.

Leave Feedback Learn about docling-java with Dosu Add Dosu to your team

dosubot[bot] avatar Mar 06 '26 11:03 dosubot[bot]