camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james strachan (JIRA)" <>
Subject [jira] [Created] (CAMEL-10646) support JSONPath on beans as well as Strings & InputStreams
Date Thu, 22 Dec 2016 14:48:58 GMT
james strachan created CAMEL-10646:

             Summary: support JSONPath on beans as well as Strings & InputStreams
                 Key: CAMEL-10646
             Project: Camel
          Issue Type: Improvement
            Reporter: james strachan

it'd be nice if we could use json path expressions on beans too; so that if some JSON gets
unmarshalled via jackson we could still use jsonPath on the object.

Here's a possible implementation approach (though maybe there's a more optimal approach?)

Maybe this code
should check if the body can't be converted to a File, String or InputStream it tries to convert
the payload to something like JSonPathNavigator (a new interface we create). If it can be
converted we use that interface to transform the payload.

Then we could have decoupled ways to convert objects into navigable formats (e.g. Maps / Lists)?

public JacksonJsonPathNavigator implements JSonPathNavigator {
  public Object convert(Object input) {
    ObjectMapper mapper = new ObjectMapper();
    return mapper.convertValue(input, Map.class);

This message was sent by Atlassian JIRA

View raw message