This is an automated email from the ASF dual-hosted git repository.
ndipiazza pushed a commit to branch tika-grpc-3x-features
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/tika-grpc-3x-features by this
push:
new db337cc5d TIKA-4252: fix issue with config param serialization.
db337cc5d is described below
commit db337cc5d5c7c510d0a9eefc12246cadc1aa2ba2
Author: Nicholas DiPiazza <[email protected]>
AuthorDate: Sun May 26 06:42:31 2024 -0500
TIKA-4252: fix issue with config param serialization.
---
.../java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
a/tika-pipes/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
b/tika-pipes/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
index b69055822..1ef13c5a7 100644
---
a/tika-pipes/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
+++
b/tika-pipes/tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java
@@ -141,7 +141,17 @@ class TikaGrpcServerImpl extends TikaGrpc.TikaImplBase {
for (var configParam : fetcherConfigParams.entrySet()) {
Element configElm =
tikaConfigDoc.createElement(configParam.getKey());
fetcher.appendChild(configElm);
- configElm.setTextContent(Objects.toString(configParam.getValue()));
+ if (configParam.getValue() instanceof List) {
+ List configParamVal = (List) configParam.getValue();
+ String singularName = configParam.getKey().substring(0,
configParam.getKey().length() - 1);
+ for (Object configParamObj : configParamVal) {
+ Element childElement =
tikaConfigDoc.createElement(singularName);
+
childElement.setTextContent(Objects.toString(configParamObj));
+ configElm.appendChild(childElement);
+ }
+ } else {
+
configElm.setTextContent(Objects.toString(configParam.getValue()));
+ }
}
}