You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hop.apache.org by "PhilipCubix (via GitHub)" <gi...@apache.org> on 2025/10/20 11:29:29 UTC
[I] [BUG] JSON Input - Missing period in JSON path expression using select fields from snippet (hop)
PhilipCubix opened a new issue, #5858:
URL: https://github.com/apache/hop/issues/5858
Hi,
when letting Hop write the JSON Path expressions for the following snippet:
`{
"@odata.context": "https://api.businesscentral.dynamics.com/v2.0/example.onmicrosoft.com/Production/api/integrator/customer/v2.0/$metadata#companies()/purchaseLines",
"value": [
{
"@odata.etag": "W/\"JzE5OzQ1MTg1MTk4MzM5Mjk4Mzc3NDQxOzAwOyc=\"",
"documentType": "Invoice"
}
],
"@odata.nextLink": "https://api.businesscentral.dynamics.com/v2.0/example.onmicrosoft.com/Production/api/integrator/customer/v2.0/companies()/purchaseLines?aid=FIN&$skiptoken='Order','129947',40000"
}`
it writes `$['@odata.context']` and `$['@odata.nextLink']` instead of `$.['@odata.context']` and `$.['@odata.nextLink']` (note the '.' after the dollar sign).
These expressions seem to work when tested on [jsonpath.com](url), but they do not work in Hop. They result in NULL when left unchanged.
The problem is solved by adding a period after the dollar sign, just in front of the square brackets.
The code that decides whether to write a period OR wrap the field name in brackets is here:
https://github.com/apache/hop/blob/aa2b439482e4a61a26d8bf82f9785f1600132e81/plugins/transforms/json/src/main/java/org/apache/hop/pipeline/transforms/jsoninput/JsonInputDialog.java#L1537
If a period would be written AND the field name would be wrapped in brackets, the JSON path expression would work. This seems to me to be the simplest solution...
(The other solution would be to look into the parser that is used at run time)
--
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: issues-unsubscribe@hop.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] JSON Input - Missing period in JSON path expression using select fields from snippet (hop)
Posted by "mattcasters (via GitHub)" <gi...@apache.org>.
mattcasters commented on issue #5858:
URL: https://github.com/apache/hop/issues/5858#issuecomment-3637691267
Add the period, thanks for the bug report.
--
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: issues-unsubscribe@hop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [BUG] JSON Input - Missing period in JSON path expression using select fields from snippet (hop)
Posted by "hansva (via GitHub)" <gi...@apache.org>.
hansva closed issue #5858: [BUG] JSON Input - Missing period in JSON path expression using select fields from snippet
URL: https://github.com/apache/hop/issues/5858
--
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: issues-unsubscribe@hop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org