You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

I am pulling in data with JSON which normally works well, however my response has a period in its nested structure
Here is my test case.
JSON data:
{"errors":{"error.loaderFailure":["This is a row of error data", "Another row of erroneous data."]}}
The correct JSONpath query is this:
"$.errors.error\.loaderFailure[*]"
The backslash should be escaping the period, but in the tFileInputJSON it is not.
I know this should work because if I change the response to look like this:
{"errors":{"error_loaderFailure":["This is a row of error data", "Another row of erroneous data."]}}
And if I change the JSONPath query in tFileInputJSON to this:
"$.errors.error_loaderFailure[*]"
Then the json file is parsed correctly.
Anyone have any insight in this? I'm using TOS 4.2.2.
Offline
Vexing problem...I tested this against your input with a '.' (parsed) and a string with '_' (rejected).
"$.errors[(\"error.loaderFailure\")][*]"
Offline

I have another question:
Is there a way to group everything under one path? Using the above example with a modification:
{"errors":{"error.loaderFailure":["This is a row of error data", "Another row of erroneous data."]}{"error.anotherTypeOfFailure":["This is a third row of error data", "The last row of erroneous data."]}}
So, let's say I want to grab everything that is at $.errors.*
My output would be:
This is a row of error data
"Another row of erroneous data.
This is a third row of error data
The last row of erroneous data.
--
This way, I can avoid having errors of the tFileInputJson component not finding the specific path? Since the errors that come back through JSON can be a wide variety of kinds of errors I've had this error: "Can't find any data with JSONPath $.errors[("error.genevaLoaderFailure")][*]". But there were infact errors coming back, just different kinds.
If this is not possible, I suppose they'd have to implement a "Ignore Missing Path" option in the tFileInputJSON component.
Thanks
Offline
Pages: 1