Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.14.2, 3.16.0
-
None
-
Advanced
Description
I have discovered that when using JSONPath in a route, the implementation does not use any ObjectMapper registered, it uses it's own.
JacksonMappingProvider.class
public class JacksonMappingProvider implements MappingProvider { private final ObjectMapper objectMapper; public JacksonMappingProvider() { this(new ObjectMapper()); } public JacksonMappingProvider(ObjectMapper objectMapper) { this.objectMapper = objectMapper; }
However, when using .jsonpathWriteAsString(), this uses global registered ObjectMapper.
JacksonJsonAdapter.class
@Override public String writeAsString(Object value, Exchange exchange) { ObjectMapper mapper = resolveObjectMapper(exchange.getContext().getRegistry()); try { return mapper.writeValueAsString(value); } catch (Throwable e) { // ignore because we are attempting to convert } return null; }
It does not go through the JsonPathEngine so it seems it's a completly differrent implementation however still defined within JSONPath language as in this documentation:
Attachments
Attachments
Issue Links
- relates to
-
CAMEL-19035 Camel-jsonpath is parsing whole json payload from 3.10.0
- Resolved
- links to