This is an automated email from the ASF dual-hosted git repository.
tballison pushed a commit to branch TIKA-4834-config-comments
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/TIKA-4834-config-comments by
this push:
new 5c451d76b4 TIKA-4834 follow-ons
5c451d76b4 is described below
commit 5c451d76b4332c532bc47041d30e6c8c525af530
Author: tallison <[email protected]>
AuthorDate: Mon Aug 24 14:54:08 2026 -0400
TIKA-4834 follow-ons
---
CHANGES.txt | 3 ++-
.../src/main/java/org/apache/tika/async/cli/TikaAsyncCLI.java | 7 +++----
.../java/org/apache/tika/pipes/core/config/ConfigMerger.java | 9 +++------
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index 00b0256a2d..7764f16272 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,7 +4,8 @@ Release 4.1.0 - unreleased
// or /* */ comments, as the configuration docs have always said they
may. The main loader accepted them; the steps that re-read the user's
file to merge in server/CLI overrides (ConfigMerger, ensurePluginRoots)
- used a strict parser and refused the whole file (TIKA-4834).
+ used their own bare parser and refused the whole file; they now use the
+ shared TikaObjectMapperFactory mapper (TIKA-4834).
* The Kafka pipes iterator no longer stops at the first empty poll. A newly
subscribed consumer spends its first poll(s) joining the group and returns
diff --git
a/tika-pipes/tika-async-cli/src/main/java/org/apache/tika/async/cli/TikaAsyncCLI.java
b/tika-pipes/tika-async-cli/src/main/java/org/apache/tika/async/cli/TikaAsyncCLI.java
index f35826f1a1..0e9f00c98e 100644
---
a/tika-pipes/tika-async-cli/src/main/java/org/apache/tika/async/cli/TikaAsyncCLI.java
+++
b/tika-pipes/tika-async-cli/src/main/java/org/apache/tika/async/cli/TikaAsyncCLI.java
@@ -25,7 +25,6 @@ import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeoutException;
-import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -39,6 +38,7 @@ import org.slf4j.LoggerFactory;
import org.apache.tika.config.EmbeddedLimits;
import org.apache.tika.config.loader.TikaJsonConfig;
+import org.apache.tika.config.loader.TikaObjectMapperFactory;
import org.apache.tika.exception.TikaConfigException;
import org.apache.tika.parser.ParseContext;
import org.apache.tika.pipes.api.FetchEmitTuple;
@@ -445,9 +445,8 @@ public class TikaAsyncCLI {
* @return the config path to use (original if plugin-roots exists, or a
new merged config)
*/
static Path ensurePluginRoots(Path originalConfigPath, String pluginsDir)
throws IOException {
- ObjectMapper mapper = new ObjectMapper();
- // The user's file may carry the // and /* */ comments the config docs
permit.
- mapper.enable(JsonParser.Feature.ALLOW_COMMENTS);
+ // The shared config mapper: same comment and strictness rules as the
main loader.
+ ObjectMapper mapper = TikaObjectMapperFactory.getMapper();
JsonNode rootNode = mapper.readTree(originalConfigPath.toFile());
if (rootNode.has("plugin-roots")) {
diff --git
a/tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/config/ConfigMerger.java
b/tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/config/ConfigMerger.java
index a2c429e035..57d92625b5 100644
---
a/tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/config/ConfigMerger.java
+++
b/tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/config/ConfigMerger.java
@@ -25,16 +25,15 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
-import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.tika.config.TimeoutLimits;
+import org.apache.tika.config.loader.TikaObjectMapperFactory;
import org.apache.tika.pipes.api.ComponentIds;
/**
@@ -91,10 +90,8 @@ public class ConfigMerger {
*/
public static MergeResult mergeOrCreate(Path existingConfig,
ConfigOverrides overrides)
throws IOException {
- ObjectMapper mapper = new ObjectMapper();
- mapper.enable(SerializationFeature.INDENT_OUTPUT);
- // The user's file may carry the // and /* */ comments the config docs
permit.
- mapper.enable(JsonParser.Feature.ALLOW_COMMENTS);
+ // The shared config mapper: same comment and strictness rules as the
main loader.
+ ObjectMapper mapper = TikaObjectMapperFactory.getMapper();
ObjectNode root;
if (existingConfig != null && Files.exists(existingConfig)) {