WMK666666 commented on PR #29594:
URL: https://github.com/apache/camel/pull/29594#issuecomment-6797356928

   `html_split_page` is in 0f523fc, and I went with the second option after 
checking what docling-serve returns.
   
   **docling-serve cannot return it in the body.** `DocumentResponse` 
(docling-serve-api 0.7.0) has content fields for doctags, html, json, markdown 
and text only — there is no split page field. And `docling-jobkit` fills 
`html_content` from `OutputFormat.HTML in conversion_options.to_formats` 
(`docling_jobkit/convert/results.py`); there is no `html_split_page` 
counterpart, so asking for it alone leaves every content field null. Mapping it 
to `html_content` in the extractor would have read a field the service never 
fills, so the empty body would stay.
   
   **What the PR does now:**
   
   - On the serve path, `buildConvertRequest` rejects it before the request is 
built, with the reason and both ways out: `useDoclingServe=false` to run the 
CLI, or `outputFormat=html` to get the whole document's HTML from 
docling-serve. No more silent empty body.
   - On the CLI path it now maps through: `--to html_split_page`, written with 
an `html` extension. docling writes the split pages as one `.html` file 
(`docling/cli/main.py`), so the extension follows `html`.
   - `DoclingServeOutputFormatTest` (new) pins the rejection, including in 
upper case, and that the five values the service can return still reach 
`toFormats`. `DoclingOutputFormatTest` gained the `--to` case and the extension 
case, so `getOutputFileExtension` is now covered — it was not asserted before, 
which is why the missing `html_split_page` case went unnoticed.
   
   Reverse-checked: dropping the guard fails only the two serve-path tests, 
dropping the `--to` case fails only `htmlSplitPageIsRequestedFromTheCli`, 
dropping the extension case fails only `htmlSplitPageIsWrittenAsHtml`.
   
   On point 2: agreed, no producer-level serve test exists for the other 
formats either — `DoclingServeProducerTest` needs a real service and is skipped 
without one. I kept the new test at the request level, which is where the bug 
was.
   
   Regression: the component's 100 unit tests pass apart from 
`DoclingCustomArgsValidationTest`, which fails the same way on an unmodified 
tree here because `/etc/cron.d` and `/var/www/html/uploads` are not absolute 
paths on Windows.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to