dan-s1 commented on code in PR #11012:
URL: https://github.com/apache/nifi/pull/11012#discussion_r3003105666


##########
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:
   Yes. That is what I ended up doing, adding a new variable named 
`invalidJsonFlowFile`.



-- 
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]

Reply via email to