dan-s1 commented on code in PR #11012:
URL: https://github.com/apache/nifi/pull/11012#discussion_r3010782603
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateJson.java:
##########
@@ -298,16 +339,25 @@ public void onTrigger(final ProcessContext context, final
ProcessSession session
}
}
+ if (schema == null) {
+ getLogger().error("JSON schema not configured for {}", flowFile);
+ session.getProvenanceReporter().route(flowFile, REL_FAILURE);
+ session.transfer(flowFile, REL_FAILURE);
+ return;
+ }
+
+ final InputFormat inputFormat =
context.getProperty(INPUT_FORMAT).asAllowableValue(InputFormat.class);
+ if (inputFormat == InputFormat.FLOW_FILE) {
+ validateFlowFile(session, flowFile);
+ } else {
+ validateJsonLines(session, flowFile);
+ }
+ }
+
+ void validateFlowFile(ProcessSession session, FlowFile flowFile) {
Review Comment:
I realize the confusion. I did not realize until now you were asking for
both methods `validateFlowFile` and `validateJsonLines` to have their
arguments final. Initially I only made the change for `validateJsonLines` and
not `validateFlowFile` . Now I have it for both. Sorry about that.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]