[
https://issues.apache.org/jira/browse/TIKA-4589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18047674#comment-18047674
]
ASF GitHub Bot commented on TIKA-4589:
--------------------------------------
nddipiazza merged PR #2483:
URL: https://github.com/apache/tika/pull/2483
> Update TikaGrpcServerImpl to use Jackson 3.0 MapperBuilder pattern
> ------------------------------------------------------------------
>
> Key: TIKA-4589
> URL: https://issues.apache.org/jira/browse/TIKA-4589
> Project: Tika
> Issue Type: Task
> Reporter: Nicholas DiPiazza
> Priority: Minor
> Labels: jackson, tika-grpc, upgrade
>
> The TikaGrpcServerImpl uses {{ObjectMapper.setDefaultPropertyInclusion()}}
> which is deprecated and will be removed in Jackson 3.0.
> *Location:*
> {{tika-grpc/src/main/java/org/apache/tika/pipes/grpc/TikaGrpcServerImpl.java:75-76}}
> *Current Code:*
> {code:java}
> private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
> static {
> //TODO with Jackson 3.0 we'll have to use MapperBuilder
> OBJECT_MAPPER.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL);
> }
> {code}
> *Required Change:*
> Update to use {{JsonMapper.builder()}} pattern instead:
> {code:java}
> private static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder()
> .serializationInclusion(JsonInclude.Include.NON_NULL)
> .build();
> {code}
> *References:*
> - Jackson 3.0 Migration Guide:
> https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0
> - The {{setDefaultPropertyInclusion()}} method is marked as deprecated for
> removal
> *Scope:*
> - Update ObjectMapper initialization in TikaGrpcServerImpl
> - Ensure compatibility with both Jackson 2.x and 3.0 if needed
> - Test JSON serialization behavior remains unchanged
--
This message was sent by Atlassian Jira
(v8.20.10#820010)