jkevan commented on code in PR #597:
URL: https://github.com/apache/unomi/pull/597#discussion_r1145835256


##########
extensions/json-schema/services/src/main/java/org/apache/unomi/schema/api/SchemaService.java:
##########
@@ -29,21 +29,39 @@ public interface SchemaService {
 
     /**
      * Verify if a jsonNode is valid against a schema
+     * (This method is fail safe, if unexpected errors happens it will returns 
false)
      *
      * @param data   to validate
      * @param schemaId id of the schema used for the validation
-     * @return true is the object is valid
+     * @return true is the object is valid, false otherwise, false also in 
case of unexpected errors !
      */
     boolean isValid(String data, String schemaId);
 
+    /**
+     * Deprecate (since 2.2.0).
+     * the eventType is now directly extracted from the event source
+     * You can directly use sibling function: isEventValid(String event)
+     */
+    @Deprecated
+    boolean isEventValid(String event, String eventType);
+
     /**
      * Verify if the event is valid
+     * (This method is fail safe, if unexpected errors happens it will returns 
false)
      *
-     * @param event   to validate
-     * @param eventType The type of the event
+     * @param event the event to check validity
+     * @return true is the event is valid, false otherwise, false also in case 
of unexpected errors !
+     */
+    boolean isEventValid(String event);
+
+    /**
+     * perform a validation on the given event
+     *
+     * @param event the event to validate
      * @return true is the event is valid
+     * @throws ValidationException in case something goes wrong and validation 
could not be performed.
      */
-    boolean isEventValid(String event, String eventType);
+    Set<ValidationError> validateEvent(String event) throws 
ValidationException;

Review Comment:
   Thx, I will fix it.



-- 
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: dev-unsubscr...@unomi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to