You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by js...@apache.org on 2023/05/02 13:55:25 UTC

[unomi] 01/01: feedback 2

This is an automated email from the ASF dual-hosted git repository.

jsinovassinnaik pushed a commit to branch UNOMI-775-add-validation-endpoint
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 245d3508be081efd7bd073993262e5c51c4f6c64
Author: jsinovassin <js...@jahia.com>
AuthorDate: Tue May 2 15:48:14 2023 +0200

    feedback 2
---
 .../src/main/java/org/apache/unomi/schema/impl/SchemaServiceImpl.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/extensions/json-schema/services/src/main/java/org/apache/unomi/schema/impl/SchemaServiceImpl.java b/extensions/json-schema/services/src/main/java/org/apache/unomi/schema/impl/SchemaServiceImpl.java
index d4b695a4d..7a98a7b52 100644
--- a/extensions/json-schema/services/src/main/java/org/apache/unomi/schema/impl/SchemaServiceImpl.java
+++ b/extensions/json-schema/services/src/main/java/org/apache/unomi/schema/impl/SchemaServiceImpl.java
@@ -114,7 +114,8 @@ public class SchemaServiceImpl implements SchemaService {
 
     @Override
     public Set<ValidationError> validateEvent(String event) throws ValidationException {
-        return validateNodeEvent(parseData(event));
+        Map<String, Set<ValidationError>> errors = validateEvents("[" + event +"]");
+        return !errors.isEmpty() ? errors.entrySet().iterator().next().getValue() : new HashSet<>();
     }
 
     @Override