You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "nddipiazza (via GitHub)" <gi...@apache.org> on 2025/12/26 16:35:11 UTC
[PR] TIKA-4589: Update ObjectMapper to use Jackson MapperBuilder pattern [tika]
nddipiazza opened a new pull request, #2483:
URL: https://github.com/apache/tika/pull/2483
## Problem
The `TikaGrpcServerImpl` uses `ObjectMapper.setDefaultPropertyInclusion()` which is deprecated and will be removed in Jackson 3.0.
## Solution
Updated to use the `JsonMapper.builder()` pattern which is:
- Compatible with Jackson 2.x (current version 2.20.1)
- Forward-compatible with Jackson 3.0
- Removes deprecation warning
**Changes:**
```java
// Before (deprecated):
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
static {
OBJECT_MAPPER.setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL);
}
// After (Jackson 3.0 ready):
private static final ObjectMapper OBJECT_MAPPER = JsonMapper.builder()
.defaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL))
.build();
```
## Testing
- ✅ `mvn clean compile` succeeds without warnings
- ✅ No deprecation warnings
- ✅ Behavior remains unchanged (non-null property inclusion)
Fixes: [TIKA-4589](https://issues.apache.org/jira/browse/TIKA-4589)
--
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: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] TIKA-4589: Update ObjectMapper to use Jackson MapperBuilder pattern [tika]
Posted by "nddipiazza (via GitHub)" <gi...@apache.org>.
nddipiazza merged PR #2483:
URL: https://github.com/apache/tika/pull/2483
--
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: dev-unsubscribe@tika.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org