From fcf5eda16af6de0bbe0c572298608b9881ca7e00 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 14 Jan 2025 18:53:12 +0100 Subject: [PATCH] Added support for generic Json Object and array --- .../gcube/informationsystem/types/PropertyTypeName.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/types/PropertyTypeName.java b/src/main/java/org/gcube/informationsystem/types/PropertyTypeName.java index c48caf3..dd4a013 100644 --- a/src/main/java/org/gcube/informationsystem/types/PropertyTypeName.java +++ b/src/main/java/org/gcube/informationsystem/types/PropertyTypeName.java @@ -14,6 +14,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import org.gcube.com.fasterxml.jackson.databind.node.ArrayNode; +import org.gcube.com.fasterxml.jackson.databind.node.ObjectNode; import org.gcube.informationsystem.base.reference.Element; import org.gcube.informationsystem.base.reference.properties.PropertyElement; import org.gcube.informationsystem.utils.Version; @@ -74,6 +76,10 @@ public class PropertyTypeName { BINARY("Binary"), BYTE("Byte"), + + JSON_OBJECT("JsonObject"), + + JSON_ARRAY("JsonArray"), /* * All base types which DON'T have a generic must be defined BEFORE BaseType.PROPERTY @@ -159,6 +165,9 @@ public class PropertyTypeName { BASE_PROPERTY_TYPES_BY_CLASS.put(byte[].class, BaseType.BINARY); BASE_PROPERTY_TYPES_BY_CLASS.put(Byte[].class, BaseType.BINARY); + + BASE_PROPERTY_TYPES_BY_CLASS.put(ObjectNode.class, BaseType.JSON_OBJECT); + BASE_PROPERTY_TYPES_BY_CLASS.put(ArrayNode.class, BaseType.JSON_ARRAY); BASE_PROPERTY_TYPES_BY_CLASS.put(PropertyElement.class, BaseType.PROPERTY);