You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nicolas Filotto (Jira)" <ji...@apache.org> on 2023/02/13 14:46:00 UTC

[jira] [Commented] (CAMEL-19035) Camel-jsonpath is parsing whole json payload from 3.10.0

    [ https://issues.apache.org/jira/browse/CAMEL-19035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17687967#comment-17687967 ] 

Nicolas Filotto commented on CAMEL-19035:
-----------------------------------------

To avoid this exception, you need to configure a custom `ObjectMapper` in order to enable the feature `
ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS` which is meant for this kind of use case. Since Camel 3.17.0 thanks to https://issues.apache.org/jira/browse/CAMEL-17956, it is possible to register a custom `ObjectMapper` directly in the Camel registry to configure once for all the expected behavior of the Jackson parser.

> Camel-jsonpath is parsing whole json payload from 3.10.0
> --------------------------------------------------------
>
>                 Key: CAMEL-19035
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19035
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jsonpath
>    Affects Versions: 3.11.0
>            Reporter: Xilai Dai
>            Assignee: Nicolas Filotto
>            Priority: Minor
>         Attachments: test-jsonpath.zip
>
>
> Given a json payload e.g:
> {code}
> {
> 	"ABC": "A",
> 	"VERSION_NO": "BASE",
> 	"DEF": [
> 		{
> 			"GGG": 1,
> 			"HHH": "N",
> 			"OOO": [
> 				{
> 					"PPP": 1,
> 					"QQQ": 555.55,
> 					"RRR": 666.66,
> 					"SSS": 0,
> 					"TTT": 777.77
> 				},
> 				{
> 					"PPP": 3,
> 					"QQQ": .05,
> 					"RRR": .10,
> 					"SSS": 0,
> 					"TTT": .10
> 				}
> 			]
> 		}
> 	]
> }
> {code}
> In case of there is something e.g invalid integer value (.05) in the payload
> - .jsonpath("$.VERSION_NO") works as expected in Camel version less than 3.10.0.
> - .jsonpath("$.VERSION_NO") will throw parse exception in Camel version great than 3.10.0.
> Investigation shows that this regression was starting happening after CAMEL-16397.
> https://github.com/apache/camel/commit/e9e8ed2057f0122f30664eb123ca00775a69c538 
> Now camel-jsonpath is trying to parse whole json payload.
> Attached test-jsonpath.zip for test/reproduce this issue.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)