Copilot commented on code in PR #3097:
URL: https://github.com/apache/tika/pull/3097#discussion_r3888895079
##########
tika-serialization/src/main/java/org/apache/tika/config/loader/TikaObjectMapperFactory.java:
##########
@@ -126,6 +127,10 @@ public static ObjectMapper createMapper(JsonFactory
factory) {
// Ensure enums are properly validated (not just numeric values)
mapper.configure(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS,
true);
+ // Accept enum values in any case ("no_ocr" as well as "NO_OCR"), the
+ // documented examples and hand-written requests use both
+ mapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS, true);
Review Comment:
The comment claims that "documented examples" use both "no_ocr" and
"NO_OCR", but the docs in this PR only show "NO_OCR" (and there are no
remaining "no_ocr" occurrences under docs/). Update the comment to avoid
stating something that is no longer true.
##########
CHANGES.txt:
##########
@@ -1,5 +1,8 @@
Release 4.1.0 - unreleased
+ * Enum values in JSON configuration are matched case-insensitively, so the
+ documented "no_ocr" works as well as "NO_OCR" (TIKA-4859).
Review Comment:
This release note says the documented "no_ocr" works, but this PR updates
the docs to only show "NO_OCR" (there are no remaining "no_ocr" examples under
docs/). Reword the entry to describe the behavior (case-insensitive matching)
without relying on a specific docs string.
--
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]