[ 
https://issues.apache.org/jira/browse/TIKA-4859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109523#comment-18109523
 ] 

ASF GitHub Bot commented on TIKA-4859:
--------------------------------------

dschmidt opened a new pull request, #3097:
URL: https://github.com/apache/tika/pull/3097

   The server docs show `"strategy": "no_ocr"`, but enum values were matched by 
`Enum.valueOf`, so that request answered 422 while `NO_OCR` worked. This 
enables `ACCEPT_CASE_INSENSITIVE_ENUMS` on the Tika ObjectMapper (unknown 
values still fail) and fixes the two docs examples. If you would rather keep 
enums strict, the docs fix alone closes the ticket.
   
   https://issues.apache.org/jira/browse/TIKA-4859
   




>  Enum values in JSON config are case-sensitive; the server docs use no_ocr
> --------------------------------------------------------------------------
>
>                 Key: TIKA-4859
>                 URL: https://issues.apache.org/jira/browse/TIKA-4859
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Dominik Schmidt
>            Priority: Major
>
> {"pdf-parser": {"ocr": {"strategy": "no_ocr"}}} is the example in 
> using-tika/server/index.adoc, but OcrConfig.Strategy is deserialized by 
> Enum.valueOf, so the request answers 422; NO_OCR works. Other enums in the 
> config (imageStrategy, suffixStrategy, ...) behave the same. Either make enum 
> deserialization case-insensitive (the UnpackConfig enums already ship a 
> parse(String) that upper-cases) or fix the documentation examples.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to