This is an automated email from the ASF dual-hosted git repository.

jiriondrusek pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/camel-main by this push:
     new e7c205338d Fixed docling issue caused by CAMEL-22984
e7c205338d is described below

commit e7c205338d98d8769db4293161a3b1e723463c96
Author: Jiri Ondrusek <[email protected]>
AuthorDate: Fri Feb 13 13:11:47 2026 +0100

    Fixed docling issue caused by CAMEL-22984
---
 .../camel/quarkus/component/docling/it/DoclingResource.java | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git 
a/integration-tests/docling/src/main/java/org/apache/camel/quarkus/component/docling/it/DoclingResource.java
 
b/integration-tests/docling/src/main/java/org/apache/camel/quarkus/component/docling/it/DoclingResource.java
index 6978d04892..d5eccbb55a 100644
--- 
a/integration-tests/docling/src/main/java/org/apache/camel/quarkus/component/docling/it/DoclingResource.java
+++ 
b/integration-tests/docling/src/main/java/org/apache/camel/quarkus/component/docling/it/DoclingResource.java
@@ -23,6 +23,7 @@ import java.nio.file.Files;
 import java.nio.file.StandardCopyOption;
 import java.util.List;
 
+import ai.docling.core.DoclingDocument;
 import io.quarkus.runtime.annotations.RegisterForReflection;
 import jakarta.enterprise.context.ApplicationScoped;
 import jakarta.inject.Inject;
@@ -141,7 +142,7 @@ public class DoclingResource {
     @Consumes(MediaType.TEXT_PLAIN)
     @Produces(MediaType.APPLICATION_JSON)
     public Response convertToJsonAsync(String documentContent) throws 
IOException {
-        return convert(documentContent, "direct:convertToJsonAsync", "Failed 
to convert to JSON async");
+        return convert(documentContent, "direct:convertToJsonAsync", "Failed 
to convert to JSON async", DoclingDocument.class);
     }
 
     @Path("/metadata/extract")
@@ -180,7 +181,8 @@ public class DoclingResource {
     @Consumes(MediaType.TEXT_PLAIN)
     @Produces(MediaType.APPLICATION_JSON)
     public Response convertToJsonWithCLI(String documentContent) throws 
IOException {
-        return convert(documentContent, "direct:convertToJsonWithCLI", "Failed 
to convert to JSON with CLI");
+        return convert(documentContent, "direct:convertToJsonWithCLI", "Failed 
to convert to JSON with CLI",
+                DoclingDocument.class);
     }
 
     @Path("/batch/convert/markdown")
@@ -195,10 +197,15 @@ public class DoclingResource {
     }
 
     private Response convert(String documentContent, String endpointUri, 
String logErrorMessage) throws IOException {
+        return convert(documentContent, endpointUri, logErrorMessage, 
String.class);
+    }
+
+    private Response convert(String documentContent, String endpointUri, 
String logErrorMessage, Class<?> resutType)
+            throws IOException {
         java.nio.file.Path tempFile = Files.createTempFile("docling-test", 
".md");
         Files.writeString(tempFile, documentContent);
         try {
-            String result = producerTemplate.requestBody(endpointUri, 
tempFile.toString(), String.class);
+            Object result = producerTemplate.requestBody(endpointUri, 
tempFile.toString(), resutType);
             return Response.ok(result).build();
         } catch (Exception e) {
             LOG.error(logErrorMessage, e);

Reply via email to