Daniel Stieglitz created NIFI-12116:
---------------------------------------
Summary: ValidateJson incorrectly considers multiline as Json
thereby allowing for validation to pass
Key: NIFI-12116
URL: https://issues.apache.org/jira/browse/NIFI-12116
Project: Apache NiFi
Issue Type: Bug
Reporter: Daniel Stieglitz
Assignee: Daniel Stieglitz
While using the ValidateJson processor as a pass through to determine whether a
file is Json we noticed when passing multiline JSON e.g.
{code:java}
{"votes": {"funny": 2, "useful": 5, "cool": 1}, "user_id": "harveydennis",
"name": "Jasmine Graham", "url":
"http://example.org/user_details?userid=harveydennis", "average_stars": 3.5,
"review_count": 12, "type": "user"}
{"votes": {"funny": 1, "useful": 2, "cool": 4}, "user_id": "njohnson", "name":
"Zachary Ballard", "url":
"https://www.example.com/user_details?userid=njohnson", "average_stars": 3.5,
"review_count": 12, "type": "user"}
{"votes": {"funny": 1, "useful": 0, "cool": 4}, "user_id": "david06", "name":
"Jonathan George", "url": "https://example.com/user_details?userid=david06",
"average_stars": 3.5, "review_count": 12, "type": "user"}
{"votes": {"funny": 6, "useful": 5, "cool": 0}, "user_id": "santiagoerika",
"name": "Amanda Taylor", "url":
"https://www.example.com/user_details?userid=santiagoerika", "average_stars":
3.5, "review_count": 12, "type": "user"}
{"votes": {"funny": 1, "useful": 8, "cool": 2}, "user_id": "rodriguezdennis",
"name": "Jennifer Roach", "url":
"http://www.example.com/user_details?userid=rodriguezdennis", "average_stars":
3.5, "review_count": 12, "type": "user"}
{code}
and specifying the schema as {} (i.e. empty schema) the flowfile content was
sent to the 'valid' relationship. This should have been sent to the invalid
relationship as technically it is not valid JSON.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)