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

   All three points are in 193e024.
   
   **1. The serve path.** Wired rather than documented as CLI-only. The 
exchange is indeed in scope, so `convertUsingDoclingServe` passes it into 
`buildConvertRequest`, which passes it into `applyConfigurationToOptions`, and 
the headers override `doOcr`/`ocrLang` with the same precedence as the CLI:
   
   - a header wins over the endpoint configuration;
   - a header that turns OCR off does not carry a language along;
   - a language header alone turns OCR on;
   - with no header, the endpoint configuration applies as before, including 
leaving `doOcr` unset so the server keeps its own defaults when nothing is 
configured.
   
   I carried the exchange through the batch and metadata operations as well, so 
a route behaves the same whichever operation it sends — 
`extractMetadataUsingApi` and the batch workers were the two places that 
dropped it.
   
   **2. The language check** is in, shared by both paths: a value that starts 
with `-`, or one with characters outside letters, digits, `_`, `-`, `,` and 
spaces, fails with an `IllegalArgumentException` naming the value. Comma 
separated lists with spaces (`en, de`) still pass. Empty is treated as "not 
set" rather than as a value.
   
   **3. Upgrade guide.** An entry under a `camel-docling` heading: the headers 
now override the endpoint, and a route that sets a language the component 
cannot pass on now fails instead of passing it through.
   
   Tests: `DoclingOcrHeadersTest` covers both paths — the four CLI cases as 
before, plus the serve request with no headers, OCR turned off, a language 
header, the fallback to the endpoint's language, and the `doOcr` option still 
being sent — and the rejection on each path. Reverse-checked: removing the 
header block fails only the four serve cases, removing either validation call 
fails only its own cases, and the CLI cases stay green throughout.
   
   Regression: 103 tests in the component, 2 failures in 
`DoclingCustomArgsValidationTest` that fail the same way on an unmodified tree 
here (POSIX absolute paths are not absolute 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