On Wed, Apr 13, 2022 at 6:47 AM Mikael Andersson Wigander <mikael.andersson.wigan...@pm.me.invalid> wrote: > > OK, will do that. > > However if I use jsonpathWriteAsString then it uses a global Objectmapper but > still my problem exists with the numerics, but that is maybe another issue !? >
I suggest to look at how jackson maps numerics, it ought to have some features/flags you can configure to control this. And an unit test is always welcome, and if you have the opportunity you are welcome to work on a PR. Its a little bit more difficult for a dataformat as the model is also represented in camel-core-model / reifier so you need to do code changes there too. > > > > /M > > > ------- Original Message ------- > On Wednesday, April 13th, 2022 at 06:44, Claus Ibsen <claus.ib...@gmail.com> > wrote: > > > > Hi > > > > Ah okay that sounds like a good improvement. You are welcome to create a > > JIRA. > > > > On Wed, Apr 13, 2022 at 6:35 AM Mikael Andersson Wigander > > mikael.andersson.wigan...@pm.me.invalid wrote: > > > > > Hi > > > > > > 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; > > > } > > > ---------------------------------------------- > > > > > > Is this the intended solution or should we make JSONPath use any globally > > > registered mapper as an option? > > > > > > I have an issue when using JSONPath and my values are numerics and large > > > decimal format like 123.456789. They get parsed as Double and then when > > > representing the json string they are in scientific notation. > > > The use of Jackson Features are not available. > > > > > > When using json as Dataformat we can register a global Objectmapper and > > > use that but when using JSONPath it is not implemented. > > > > > > My Camel version is 3.14.1 > > > > > > > > > /M > > > > > > > > > > -- > > Claus Ibsen > > ----------------- > > http://davsclaus.com @davsclaus > > Camel in Action 2: https://www.manning.com/ibsen2 -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2