UNOMI-569 Flatten JSON Schemas & fix schema bugs (#428)
* UNOMI-569 Flatten JSON Schemas & fix schema bugs
- All schemas are now "flattened", meaning that each object is in a separate schema file (with a few exceptions)
- Bug fixes in GraphQLSchemaProvider to detect loops in schemas
- Fix events used in integration tests to avoid sending profile objects
- Changed Event default initialization to avoid creating attributes when using default constructor
- Added JAXBAnnotationModule in object mapper used in integration tests
- Added system property to control logging in integration tests (to make it easier to see invalid schema logs that exist only in debug)
- Fix deployment of test schemas in integration tests
-
* UNOMI-569 Flatten JSON Schemas & fix schema bugs
- Change vendor to use a real entity name
* UNOMI-569 Flatten JSON Schemas & fix schema bugs
- Change vendor to be a real entity name
* UNOMI-569 Flatten schemas
- Move page and site to top level objects
- Page and site are now using item as parent validation instead of custom item
- Removed conditiontype JSON schema as it is not needed.
* UNOMI-569 Flatten schemas
- Move page and site to top level objects
- Page and site are now using item as parent validation instead of custom item
- Removed conditiontype JSON schema as it is not needed.
* UNOMI-569: cleanup schemas
* UNOMI-569: fix pageInfo schema for view event
* UNOMI-569: cleanup unused code/imports in tests
Co-authored-by: Kevan <kevan@jahia.com>
diff --git a/api/src/main/java/org/apache/unomi/api/Event.java b/api/src/main/java/org/apache/unomi/api/Event.java
index 3d41825..0397b8a 100644
--- a/api/src/main/java/org/apache/unomi/api/Event.java
+++ b/api/src/main/java/org/apache/unomi/api/Event.java
@@ -74,7 +74,7 @@
private boolean persistent = true;
- private transient Map<String, Object> attributes = new LinkedHashMap<>();
+ private transient Map<String, Object> attributes;
/**
* Instantiates a new Event.
@@ -170,7 +170,8 @@
this.properties = new HashMap<>();
this.flattenedProperties = new HashMap<>();
- actionPostExecutors = new ArrayList<>();
+ this.actionPostExecutors = new ArrayList<>();
+ this.attributes = new LinkedHashMap<>();
}
/**
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json
deleted file mode 100644
index 71dbe42..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/condition.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/condition/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Condition",
- "type": "object",
- "properties" : {
- "conditionTypeId" : {
- "type" : "string"
- },
- "parameterValues" : {
- "type" : "object",
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json
deleted file mode 100644
index 22e1ad0..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/conditiontype.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/conditiontype/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "ConditionType",
- "type": "object",
- "properties" : {
- "conditionEvaluator" : {
- "type" : "string"
- },
- "queryBuilder" : {
- "type" : "string"
- },
- "parentCondition" : {
- "$ref" : "https://unomi.apache.org/schemas/json/condition/1-0-0"
- },
- "parameters" : {
- "type" : "object",
- "additionalProperties": { "$ref" : "https://unomi.apache.org/schemas/json/parameter/1-0-0" },
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json
deleted file mode 100644
index 3ae685a..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitem.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/customitem/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "CustomItem",
- "type": "object",
- "allOf": [
- {
- "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0"
- }
- ],
- "properties": {
- "customItemType" : {
- "type" : "string"
- },
- "properties" : {
- "type" : "object",
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json
deleted file mode 100644
index fb2874f..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/page.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/customitems/page/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "customitems",
- "name":"page",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "PageCustomItem",
- "type": "object",
- "allOf": [
- {
- "$ref": "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- ],
- "properties": {
- "pageInfo": {
- "type" : "object",
- "properties" : {
- "templateName": {
- "type" : "string"
- },
- "language": {
- "type" : "string",
- "maxLength": 5
- },
- "destinationURL": {
- "type" : "string",
- "format" : "uri"
- },
- "categories": {
- "type" : "array",
- "items" : { "type" : "string"}
- },
- "pageID": {
- "type" : "string",
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- },
- "nodeType": {
- "type" : "string"
- },
- "pagePath": {
- "type" : "string"
- },
- "pageName": {
- "type" : "string"
- },
- "referringURL": {
- "type" : "string",
- "format" : "uri"
- },
- "tags": {
- "type" : "array",
- "items" : { "type" : "string" }
- },
- "isContentTemplate": {
- "type" : "boolean"
- }
- }
- },
- "attributes": {
- "type" : ["null", "object"]
- },
- "consentTypes": {
- "type" : ["null", "array"],
- "items" : {
- "$href" : "https://unomi.apache.org/schemas/json/consentType/1-0-0"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json
deleted file mode 100644
index 2d67e75..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/customitems/site.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/customitems/site/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "customitems",
- "name": "site",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "SiteCustomItem",
- "type": "object",
- "allOf": [
- {
- "$ref": "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- ],
- "properties": {
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/anonymizeProfile.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/anonymizeProfile.json
deleted file mode 100644
index bdfabc0..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/anonymizeProfile.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/anonymizeProfile/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "anonymizeProfile",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "AnonymizeProfileEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/articleCompleted.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/articleCompleted.json
deleted file mode 100644
index d493adf..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/articleCompleted.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/articleCompleted/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "articleCompleted",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "AnonimyzeProfileEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/event.json
similarity index 81%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/event.json
index 7c3b5bf..29fa59c 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/event.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/event.json
@@ -1,6 +1,12 @@
{
"$id": "https://unomi.apache.org/schemas/json/event/1-0-0",
"$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "event",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
"title": "Event",
"type": "object",
"allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/timestampeditem/1-0-0" }],
@@ -24,6 +30,9 @@
"sourceId" : {
"type" : [ "string"],
"pattern" : "^(\\w|[-_@\\.]){0,60}$"
+ },
+ "persistent" : {
+ "type" : "boolean"
}
}
}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json
deleted file mode 100644
index e4c1575..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/form.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/form/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "form",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "FormEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "unomiFormMappingLookup" : true,
- "maxProperties": 50
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/site/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json
deleted file mode 100644
index 3c5a289..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/goal.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/goal/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "goal",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "GoalEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/identify.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/identify.json
deleted file mode 100644
index 657235b..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/identify.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/identify/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "identify",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "IdentifyEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json
deleted file mode 100644
index 8ae788c..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/incrementInterest/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "incrementInterest",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "IncrementInterestEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/incrementInterest.flattenProperties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/incrementInterest.flattenProperties.json
new file mode 100644
index 0000000..1793e5c
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/incrementInterest.flattenProperties.json
@@ -0,0 +1,18 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/events/incrementInterest/flattenProperties/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "incrementInterestFlattenProperties",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "IncrementInterestFlattenProperties",
+ "type": "object",
+ "properties" : {
+ "interests": {
+ "$ref" : "https://unomi.apache.org/schemas/json/interests/1-0-0"
+ }
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/incrementInterest.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/incrementInterest.json
new file mode 100644
index 0000000..73516ac
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/incrementInterest/incrementInterest.json
@@ -0,0 +1,20 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/events/incrementInterest/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "target" : "events",
+ "name": "incrementInterest",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "IncrementInterestEvent",
+ "type": "object",
+ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
+ "properties" : {
+ "flattenedProperties" : {
+ "$ref" : "https://unomi.apache.org/schemas/json/events/incrementInterest/flattenProperties/1-0-0"
+ }
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login/login.json
similarity index 76%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login/login.json
index f00ef58..fdb4c30 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/login/login.json
@@ -14,11 +14,8 @@
"properties" : {
"properties" : {
"type" : "object",
- "unomiPropertyTypes" : [ "events" ],
"maxProperties": 50
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
}
- }
+ },
+ "$comment" : "WARNING: This schema is open and do not restrict unevaluated properties because it is protected with third-party server key check"
}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/modifyConsent.json
similarity index 61%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/modifyConsent.json
index 1f748e0..ecd26b8 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/modifyConsent.json
@@ -13,18 +13,14 @@
"allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
"properties" : {
"properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
+ "$ref" : "https://unomi.apache.org/schemas/json/events/modifyConsent/properties/1-0-0"
},
"source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
+ "$ref" : "https://unomi.apache.org/schemas/json/items/page/1-0-0"
},
"target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
+ "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
}
- }
+ },
+ "unevaluatedProperties" : false
}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/modifyConsent.properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/modifyConsent.properties.json
new file mode 100644
index 0000000..dec05c5
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/modifyConsent/modifyConsent.properties.json
@@ -0,0 +1,18 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/events/modifyConsent/properties/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "modifyConsentProperties",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "ModifyConsentProperties",
+ "type": "object",
+ "properties" : {
+ "consent" : {
+ "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
+ }
+ },
+ "unevaluatedProperties": false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileDeleted.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileDeleted.json
deleted file mode 100644
index d6534d3..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileDeleted.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/profileDeleted/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "profileDeleted",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "ProfileDeletedEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileUpdated.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileUpdated.json
deleted file mode 100644
index b936cdd..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/profileUpdated.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/profileUpdated/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "profileUpdated",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "ProfileUpdatedEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/ruleFired.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/ruleFired.json
deleted file mode 100644
index 615eb81..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/ruleFired.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/ruleFired/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "ruleFired",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "RuleFiredEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/search.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/search.json
deleted file mode 100644
index 4804547..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/search.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/search/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "search",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "SearchEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionCreated.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionCreated.json
deleted file mode 100644
index 5149674..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionCreated.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/sessionCreated/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "sessionCreated",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "SessionCreatedEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionReassigned.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionReassigned.json
deleted file mode 100644
index 7a7f338..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/sessionReassigned.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/sessionReassigned/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "sessionReassigned",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "SessionReassignedEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json
deleted file mode 100644
index 4cd408e..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/events/updateProperties/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "self":{
- "vendor":"org.apache.unomi",
- "target" : "events",
- "name": "updateProperties",
- "format":"jsonschema",
- "version":"1-0-0"
- },
- "title": "UpdatePropertiesEvent",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
- "properties" : {
- "properties" : {
- "type" : "object",
- "properties" : {
- "consent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/consent/1-0-0"
- }
- }
- },
- "source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
- },
- "target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties/updateProperties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties/updateProperties.json
new file mode 100644
index 0000000..43c22ac
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/updateProperties/updateProperties.json
@@ -0,0 +1,21 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/events/updateProperties/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "target" : "events",
+ "name": "updateProperties",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "UpdatePropertiesEvent",
+ "type": "object",
+ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
+ "properties" : {
+ "properties" : {
+ "type" : "object",
+ "maxProperties": 50
+ }
+ },
+ "$comment" : "WARNING: This schema is open and do not restrict unevaluated properties because it is protected with third-party server key check"
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view/view.flattenProperties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view/view.flattenProperties.json
new file mode 100644
index 0000000..c380b0d
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view/view.flattenProperties.json
@@ -0,0 +1,18 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/events/view/flattenProperties/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "viewFlattenProperties",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "ViewFlattenProperties",
+ "type": "object",
+ "properties" : {
+ "interests": {
+ "$ref" : "https://unomi.apache.org/schemas/json/interests/1-0-0"
+ }
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view/view.json
similarity index 61%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view/view.json
index 1840449..cefe46e 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/events/view/view.json
@@ -12,15 +12,15 @@
"type": "object",
"allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
"properties" : {
- "properties" : {
- "type" : "object",
- "maxProperties": 50
- },
"source" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/site/1-0-0"
+ "$ref" : "https://unomi.apache.org/schemas/json/items/site/1-0-0"
},
"target" : {
- "$ref" : "https://unomi.apache.org/schemas/json/customitems/page/1-0-0"
+ "$ref" : "https://unomi.apache.org/schemas/json/items/page/1-0-0"
+ },
+ "flattenedProperties": {
+ "$ref" : "https://unomi.apache.org/schemas/json/events/view/flattenProperties/1-0-0"
}
- }
+ },
+ "unevaluatedProperties": false
}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json
deleted file mode 100644
index 57d922b..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/goal.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/goal/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Goal",
- "type": "object",
- "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/metadataitem/1-0-0" }],
- "properties" : {
- "startEvent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/condition/1-0-0"
- },
- "targetEvent" : {
- "$ref" : "https://unomi.apache.org/schemas/json/condition/1-0-0"
- },
- "campaignId" : {
- "type" : "string"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/consent/consent.json
similarity index 76%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/consent/consent.json
index bb357fe..557bb25 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consent.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/consent/consent.json
@@ -1,6 +1,12 @@
{
"$id": "https://unomi.apache.org/schemas/json/consent/1-0-0",
"$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "consent",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
"title": "Consent",
"type": "object",
"properties" : {
@@ -21,5 +27,6 @@
"type" : "string",
"format" : "date-time"
}
- }
+ },
+ "unevaluatedProperties": false
}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/consent/consentType.json
similarity index 72%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/consent/consentType.json
index 034a531..995f77f 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/consentType.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/consent/consentType.json
@@ -1,6 +1,12 @@
{
"$id": "https://unomi.apache.org/schemas/json/consentType/1-0-0",
"$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "consentType",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
"title": "ConsentType",
"type": "object",
"properties" : {
@@ -16,5 +22,6 @@
"description" : {
"type" : ["null", "string"]
}
- }
+ },
+ "unevaluatedProperties": false
}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/interests/interests.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/interests/interests.json
new file mode 100644
index 0000000..74bc6c8
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/interests/interests.json
@@ -0,0 +1,18 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/interests/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "interests",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "Interests",
+ "type": "object",
+ "patternProperties": {
+ "^.*$": {
+ "type": "number"
+ }
+ },
+ "unevaluatedProperties": false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/item.json
similarity index 81%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/item.json
index c9b697b..5c71db4 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/item.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/item.json
@@ -1,6 +1,12 @@
{
"$id": "https://unomi.apache.org/schemas/json/item/1-0-0",
"$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "item",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
"title": "Item",
"type": "object",
"properties" : {
@@ -21,11 +27,6 @@
"type" : ["null","integer"],
"minimum" : 0,
"description" : "The item's version number"
- },
- "systemMetadata" : {
- "type" : ["null","object"],
- "description" : "Any system metadata for the item",
- "maxProperties" : 50
}
}
}
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.json
new file mode 100644
index 0000000..ec52e58
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.json
@@ -0,0 +1,19 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/items/page/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name":"page",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "PageCustomItem",
+ "type": "object",
+ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0" }],
+ "properties": {
+ "properties" : {
+ "$ref" : "https://unomi.apache.org/schemas/json/items/page/properties/1-0-0"
+ }
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.attributes.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.attributes.json
new file mode 100644
index 0000000..cb54c2a
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.attributes.json
@@ -0,0 +1,15 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/items/page/properties/attributes/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self": {
+ "vendor": "org.apache.unomi",
+ "name": "attributes",
+ "format": "jsonschema",
+ "version": "1-0-0"
+ },
+ "title": "Page Attributes",
+ "type": ["null", "object"],
+ "properties": {
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.json
new file mode 100644
index 0000000..3abfd4d
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.json
@@ -0,0 +1,27 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/items/page/properties/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name":"pageProperties",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "PageProperties",
+ "type": "object",
+ "properties": {
+ "pageInfo": {
+ "$ref" : "https://unomi.apache.org/schemas/json/items/page/properties/pageInfo/1-0-0"
+ },
+ "attributes": {
+ "$ref" : "https://unomi.apache.org/schemas/json/items/page/properties/attributes/1-0-0"
+ },
+ "consentTypes": {
+ "type" : ["null", "array"],
+ "items" : {
+ "$ref" : "https://unomi.apache.org/schemas/json/consentType/1-0-0"
+ }
+ }
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.pageInfo.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.pageInfo.json
new file mode 100644
index 0000000..8f1702e
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/page/page.properties.pageInfo.json
@@ -0,0 +1,63 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/items/page/properties/pageInfo/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self": {
+ "vendor": "org.apache.unomi",
+ "name": "pageInfo",
+ "format": "jsonschema",
+ "version": "1-0-0"
+ },
+ "title": "PageInfo",
+ "type": "object",
+ "properties": {
+ "templateName": {
+ "type": ["null", "string"]
+ },
+ "language": {
+ "type": ["null", "string"],
+ "maxLength": 5
+ },
+ "destinationURL": {
+ "type": ["null", "string"],
+ "format": "uri"
+ },
+ "destinationSearch": {
+ "type": ["null", "string"]
+ },
+ "categories": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "pageID": {
+ "type": ["null", "string"]
+ },
+ "nodeType": {
+ "type": ["null", "string"]
+ },
+ "pagePath": {
+ "type": ["null", "string"]
+ },
+ "pageName": {
+ "type": ["null", "string"]
+ },
+ "referringURL": {
+ "type": ["null", "string"],
+ "format": "uri"
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "isContentTemplate": {
+ "type": ["null", "boolean"]
+ },
+ "sameDomainReferrer": {
+ "type": ["null", "boolean"]
+ }
+ },
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/site/site.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/site/site.json
new file mode 100644
index 0000000..c73afaf
--- /dev/null
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/site/site.json
@@ -0,0 +1,14 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/items/site/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "site",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "SiteItem",
+ "type": "object",
+ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0" }],
+ "unevaluatedProperties" : false
+}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/timestampeditem.json
similarity index 73%
rename from extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json
rename to extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/timestampeditem.json
index b1e8156..db8f078 100644
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/timestampeditem.json
+++ b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/items/timestampeditem.json
@@ -1,6 +1,12 @@
{
"$id": "https://unomi.apache.org/schemas/json/timestampeditem/1-0-0",
"$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "timestampedItem",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
"title": "TimestampedItem",
"type": "object",
"allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0" }],
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json
deleted file mode 100644
index 03d4f71..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadata.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/metadata/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Metadata",
- "type": "object",
- "properties" : {
- "id" : {
- "type" : "string"
- },
- "name" : {
- "type" : "string"
- },
- "description" : {
- "type" : "string"
- },
- "scope" : {
- "type" : "string"
- },
- "tags" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "systemTags" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "enabled" : {
- "type" : "boolean"
- },
- "missingPlugins" : {
- "type" : "boolean"
- },
- "hidden" : {
- "type" : "boolean"
- },
- "readOnly" : {
- "type" : "boolean"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json
deleted file mode 100644
index fcdbe1c..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/metadataitem.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/metadataitem/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "MetadataItem",
- "type": "object",
- "allOf": [
- { "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0" }
- ],
- "properties" : {
- "metadata" : {
- "$ref" : "https://unomi.apache.org/schemas/json/metadata/1-0-0"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json
deleted file mode 100644
index cba8c6d..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/parameter.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/parameter/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Parameter",
- "type": "object",
- "properties" : {
- "id" : {
- "type" : "string"
- },
- "type" : {
- "type" : "string"
- },
- "multivalued" : {
- "type" : "boolean"
- },
- "defaultValue" : {
- "type" : "string"
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json
deleted file mode 100644
index 112be92..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/filter.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/personalization/filter/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Filter",
- "type": "object",
- "properties": {
- "appliesOn": {
- "type": "array",
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/personalization/target/1-0-0"
- }
- },
- "condition": {
- "$ref": "https://unomi.apache.org/schemas/json/condition/1-0-0"
- },
- "properties": {
- "type": "object",
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json
deleted file mode 100644
index 37e99f7..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizationrequest.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/personalization/personalizedrequest/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "PersonalizationRequest",
- "type": "object",
- "properties": {
- "id" : {
- "type" : "string"
- },
- "strategy" : {
- "type" : "string"
- },
- "strategyOptions" : {
- "type": "object",
- "maxProperties": 50
- },
- "contents" : {
- "type" : "array",
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/personalization/personalizedcontent/1-0-0"
- },
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json
deleted file mode 100644
index b8a29ef..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/personalizedcontent.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/personalization/personalizedcontent/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "PersonalizedContent",
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "filters": {
- "type": "array",
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/personalization/filter/1-0-0"
- },
- "maxProperties": 50
- },
- "properties": {
- "type": "object",
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json
deleted file mode 100644
index 4de017a..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/personalization/target.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/personalization/target/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Target",
- "type": "object",
- "properties": {
- "target" : {
- "type" : "string"
- },
- "values" : {
- "type" : "array",
- "items": {
- "type": "string"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json
deleted file mode 100644
index e32eef5..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/profile.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/profile/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Profile",
- "type": "object",
- "allOf": [
- {
- "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0"
- }
- ],
- "properties": {
- "properties" : {
- "type" : "object",
- "unomiPropertyTypes" : [ "profiles" ],
- "maxProperties": 50
- },
- "systemProperties" : {
- "type" : "object",
- "maxProperties": 50
- },
- "segments" : {
- "type" : "array",
- "items" : {
- "type" : "string"
- }
- },
- "scores" : {
- "type" : "object",
- "additionalProperties": { "type": "integer" },
- "maxProperties": 100
- },
- "mergedWith" : {
- "type" : "string"
- },
- "consents" : {
- "type" : "object",
- "additionalProperties": { "$ref" : "https://unomi.apache.org/schemas/json/consent.json" },
- "maxProperties": 50
- }
- }
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/session.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/session.json
deleted file mode 100644
index 8f7b767..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/session.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/session/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Session",
- "type": "object",
- "allOf": [
- {
- "$ref": "https://unomi.apache.org/schemas/json/timestampeditem/1-0-0"
- }
- ],
- "properties": {
- "profileId" : {
- "type" : "string"
- },
- "profile" : {
- "$ref" : "https://unomi.apache.org/schemas/json/profile/1-0-0"
- },
- "properties" : {
- "type" : "object",
- "unomiPropertyTypes" : [ "sessions" ],
- "maxProperties": 50
- },
- "systemProperties" : {
- "type" : "object",
- "maxProperties": 50
- },
- "timeStamp" : {
- "type" : "string",
- "format" : "date-time"
- },
- "lastEventDate" : {
- "type" : "string",
- "format" : "date-time"
- },
- "size" : {
- "type" : "integer"
- },
- "duration" : {
- "type" : "integer"
- }
- }
-}
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json
deleted file mode 100644
index 752057b..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/boolean.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/boolean/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Boolean",
- "type": "boolean"
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json
deleted file mode 100644
index 2ad0739..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/date.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/date/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Date",
- "type": "string",
- "format" : "date-time"
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json
deleted file mode 100644
index d425eff..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/email.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/email/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Email",
- "type": "string",
- "format" : "email"
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json
deleted file mode 100644
index b3c68a6..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/integer.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/integer/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Integer",
- "type": "integer"
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json
deleted file mode 100644
index 9eb7c8d..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/long.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/long/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Long",
- "type": "integer"
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json
deleted file mode 100644
index 9f43666..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/set.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/set/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Set",
- "type": "object",
- "maxProperties": 50
-}
\ No newline at end of file
diff --git a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json b/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json
deleted file mode 100644
index f0b9c30..0000000
--- a/extensions/json-schema/services/src/main/resources/META-INF/cxs/schemas/values/string.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/values/string/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "String",
- "type": "string"
-}
\ No newline at end of file
diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
index 84b9ec8..a4b082d 100644
--- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
+++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/GraphQLSchemaProvider.java
@@ -164,11 +164,16 @@
Optional<JSONType> firstNonNullType = jsonTypes.stream().filter(jsonType -> !"null".equals(jsonType.getType())).findFirst();
if (firstNonNullType.isPresent()) {
this.firstNonNullType = firstNonNullType.get();
+ } else {
+ logger.warn("Couldn't find non null type for {} and types {}", name, jsonTypes);
}
}
@Override
public String getTypeId() {
+ if (firstNonNullType == null) {
+ return null;
+ }
return firstNonNullType.getType();
}
@@ -345,7 +350,7 @@
final GraphQLInputObjectType objectType;
if (!graphQLAnnotations.getContainer().getTypeRegistry().containsKey(typeName)) {
- objectType = createDynamicEventInputType(new JSONTypeDefinitionType(unomiEventType.getName(), unomiEventType.getRootTypes()));
+ objectType = createDynamicEventInputType(new JSONTypeDefinitionType(unomiEventType.getName(), unomiEventType.getRootTypes()), new ArrayDeque<>());
} else {
objectType = (GraphQLInputObjectType) getFromTypeRegistry(typeName);
registerDynamicInputFields(typeName, objectType, new JSONTypeDefinitionType(unomiEventType.getName(), unomiEventType.getRootTypes()).getSubTypes());
@@ -525,15 +530,23 @@
return null;
}
- private GraphQLInputObjectType createDynamicEventInputType(final DefinitionType eventType) {
- return createDynamicInputType(UnomiToGraphQLConverter.convertEventType(eventType.getName()), eventType.getSubTypes(), true);
+ private GraphQLInputObjectType createDynamicEventInputType(final DefinitionType eventType, Deque<String> typeStack) {
+ return createDynamicInputType(UnomiToGraphQLConverter.convertEventType(eventType.getName()), eventType.getSubTypes(), true, typeStack);
}
- private GraphQLInputObjectType createDynamicSetInputType(final DefinitionType propertyType, final String parentName) {
- return createDynamicInputType(parentName != null ? parentName : propertyType.getName(), propertyType.getSubTypes(), false);
+ private GraphQLInputObjectType createDynamicSetInputType(final DefinitionType propertyType, final String parentName, Deque<String> typeStack) {
+ return createDynamicInputType(parentName != null ? parentName : propertyType.getName(), propertyType.getSubTypes(), false, typeStack);
}
- private GraphQLInputObjectType createDynamicInputType(final String name, final List<DefinitionType> propertyTypes, final boolean isEvent) {
+ private GraphQLInputObjectType createDynamicInputType(final String name,
+ final List<DefinitionType> propertyTypes,
+ final boolean isEvent,
+ Deque<String> typeStack) {
+ if (typeStack.contains(name)) {
+ logger.error("Loop detected when creating dynamic input types {} !" , typeStack);
+ return null;
+ }
+ typeStack.push(name);
final String typeName = StringUtils.capitalize(PropertyNameTranslator.translateFromUnomiToGraphQL(name)) + "Input";
final GraphQLInputObjectType.Builder dynamicTypeBuilder = GraphQLInputObjectType.newInputObject()
@@ -554,7 +567,7 @@
GraphQLInputType objectType;
if (isSet) {
- objectType = createDynamicSetInputType(childPropertyType, typeName + "_" + childPropertyName);
+ objectType = createDynamicSetInputType(childPropertyType, typeName + "_" + childPropertyName, typeStack);
} else {
objectType = (GraphQLInputType) UnomiToGraphQLConverter.convertPropertyType(childPropertyType.getTypeId());
}
@@ -572,8 +585,10 @@
fieldDefinitions.forEach(dynamicTypeBuilder::field);
final GraphQLInputObjectType objectType = dynamicTypeBuilder.build();
registerInTypeRegistry(typeName, objectType);
+ typeStack.pop();
return objectType;
} else {
+ typeStack.pop();
return null;
}
}
@@ -597,7 +612,7 @@
final String typeName = StringUtils.capitalize(propertyName) + "Input";
if (!graphQLAnnotations.getContainer().getTypeRegistry().containsKey(typeName)) {
- final GraphQLInputObjectType inputType = createDynamicSetInputType(propertyType, null);
+ final GraphQLInputObjectType inputType = createDynamicSetInputType(propertyType, null, new ArrayDeque<>());
if (inputType != null) {
fieldDefinitions.add(GraphQLInputObjectField.newInputObjectField()
.name(propertyName)
diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java
index be91e0a..ca57704 100644
--- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java
+++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/schema/json/JSONObjectType.java
@@ -16,12 +16,17 @@
*/
package org.apache.unomi.graphql.schema.json;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class JSONObjectType extends JSONType {
+ private static final Logger logger = LoggerFactory.getLogger(JSONTypeFactory.class);
+
Map<String, List<JSONType>> properties = new HashMap<>();
JSONType additionalProperties;
Map<String, List<JSONType>> patternProperties = new HashMap<>();
@@ -35,7 +40,11 @@
Map<String, Object> propertiesTree = (Map<String, Object>) schemaTree.get("properties");
if (propertiesTree != null) {
propertiesTree.entrySet().forEach(entry -> {
- properties.put(entry.getKey(), jsonTypeFactory.getTypes((Map<String, Object>) entry.getValue()));
+ if (entry.getValue() instanceof Map) {
+ properties.put(entry.getKey(), jsonTypeFactory.getTypes((Map<String, Object>) entry.getValue()));
+ } else {
+ logger.error("Expected map type for property {}, instead found {}", entry.getKey(), entry.getValue().getClass());
+ }
});
}
}
diff --git a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java
index 9c94efa..b8948fe 100644
--- a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java
+++ b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/utils/EventBuilder.java
@@ -69,7 +69,7 @@
}
public Event build() {
- final Event event = new Event(eventType, null, profile, null, null, profile, new Date());
+ final Event event = new Event(eventType, null, profile, null, null, null, new Date());
event.setPersistent(persistent);
event.setProperty("targetId", profile.getItemId());
event.setProperty("targetType", Profile.ITEM_TYPE);
diff --git a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
index cbb1b9d..0c400b9 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BaseIT.java
@@ -18,7 +18,9 @@
package org.apache.unomi.itests;
import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
import org.apache.commons.io.IOUtils;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
@@ -132,6 +134,8 @@
static {
objectMapper = new ObjectMapper();
+ objectMapper.registerModule(new JaxbAnnotationModule());
+ objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}
@@ -276,6 +280,13 @@
LOGGER.warn("Unable to set jacoco agent as {} was not found", agentFile);
}
+ String customLogging = System.getProperty("it.karaf.customLogging");
+ if (customLogging != null) {
+ String[] customLoggingParts = customLogging.split(":");
+ options.add(editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j2.logger.customLogging.name", customLoggingParts[0]));
+ options.add(editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg", "log4j2.logger.customLogging.level", customLoggingParts[1]));
+ }
+
if (JavaVersionUtil.getMajorVersion() >= 9) {
Option[] jdk9PlusOptions = new Option[] { new VMOption("--add-reads=java.xml=java.logging"),
new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
index b90c0b0..941072c 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
@@ -17,9 +17,6 @@
package org.apache.unomi.itests;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@@ -36,7 +33,6 @@
import org.apache.unomi.api.rules.Rule;
import org.apache.unomi.api.services.DefinitionsService;
import org.apache.unomi.api.services.ProfileService;
-import org.apache.unomi.api.services.RulesService;
import org.apache.unomi.itests.tools.httpclient.HttpClientThatWaitsForUnomi;
import org.apache.unomi.persistence.spi.CustomObjectMapper;
import org.junit.Assert;
@@ -52,7 +48,6 @@
import javax.inject.Inject;
import java.io.File;
import java.io.IOException;
-import java.text.SimpleDateFormat;
import java.util.*;
@@ -69,6 +64,7 @@
private static final String SESSION_ID_4 = "aa3b04bd-8f4d-4a07-8e96-d33ffa04d3d4";
private static final String EVENT_TYPE_LOGIN = "login";
+ private static final String EVENT_TYPE_LOGIN_SCHEMA = "schemas/events/login.json";
private static final String EVENT_TYPE_VIEW = "view";
private static final String TEST_SCOPE = "testScope";
@@ -93,8 +89,6 @@
private static final String EMAIL_VISITOR_2 = "visitor2@apache.unomi.org";
@Inject @Filter(timeout = 600000)
- protected RulesService rulesService;
- @Inject @Filter(timeout = 600000)
protected ProfileService profileService;
@Inject @Filter(timeout = 600000)
protected DefinitionsService definitionsService;
@@ -149,6 +143,7 @@
@Test
public void testMultipleLoginOnSameBrowser() throws IOException, InterruptedException {
LOGGER.info("Start test testMultipleLoginOnSameBrowser");
+
// Add login event condition
ConditionType conditionType = CustomObjectMapper.getObjectMapper().readValue(
new File("data/tmp/testLoginEventCondition.json").toURI().toURL(), ConditionType.class);
@@ -269,6 +264,7 @@
checkVisitor1ResponseProperties(profileVisitor1.getProperties());
Profile profileVisitor2 = profileService.load(profileIdVisitor2);
checkVisitor2ResponseProperties(profileVisitor2.getProperties());
+
LOGGER.info("End test testMultipleLoginOnSameBrowser");
}
@@ -278,8 +274,12 @@
CustomItem loginEventTarget = new CustomItem(visitorId, ITEM_TYPE_VISITOR);
loginEventTarget.setProperties(loginEventProperties);
- Event loginEvent = new Event(EVENT_TYPE_LOGIN, null, new Profile(""), TEST_SCOPE,
- null, loginEventTarget, new Date());
+ // We use setters to avoid having auto-populated fields by the other event constructor methods.
+ Event loginEvent = new Event();
+ loginEvent.setEventType(EVENT_TYPE_LOGIN);
+ loginEvent.setScope(TEST_SCOPE);
+ loginEvent.setTarget(loginEventTarget);
+ loginEvent.setTimeStamp(new Date());
ContextRequest contextRequest = new ContextRequest();
contextRequest.setSource(sourceSite);
@@ -301,8 +301,14 @@
customPageItem.setProperties(properties);
- // Create page view event to mock a connection to a site
- Event pageViewEvent = new Event(EVENT_TYPE_VIEW, null, new Profile(""), TEST_SCOPE, sourceSite, customPageItem, new Date());
+ // Create page view event to mock a connection to a site. We use setters to avoid having auto-populated fields
+ Event pageViewEvent = new Event();
+ pageViewEvent.setEventType(EVENT_TYPE_VIEW);
+ pageViewEvent.setSessionId(sessionId);
+ pageViewEvent.setScope(TEST_SCOPE);
+ pageViewEvent.setSource(sourceSite);
+ pageViewEvent.setTarget(customPageItem);
+ pageViewEvent.setTimeStamp(new Date());
// Initialize context like if you display the first page on the website
ContextRequest contextRequest = new ContextRequest();
diff --git a/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java b/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java
index 1ef7b80..1deb98c 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ModifyConsentIT.java
@@ -72,7 +72,7 @@
Assert.assertNotNull(profile);
Assert.assertEquals(0, profile.getConsents().size());
- Event modifyConsentEvent = new Event("modifyConsent", null, profile, null, null, profile, new Date());
+ Event modifyConsentEvent = new Event("modifyConsent", null, profile, null, null, null, new Date());
modifyConsentEvent.setPersistent(false);
ISO8601DateFormat dateFormat = new ISO8601DateFormat();
diff --git a/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java b/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java
index 8dd022a..4628332 100644
--- a/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/PropertiesUpdateActionIT.java
@@ -97,7 +97,7 @@
Profile profile = profileService.load(PROFILE_TARGET_TEST_ID);
Assert.assertNull(profile.getProperty("firstName"));
- Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
Map<String, Object> propertyToUpdate = new HashMap<>();
@@ -121,7 +121,7 @@
Profile profileToUpdate = profileService.load(PROFILE_TEST_ID);
Assert.assertNull(profileToUpdate.getProperty("firstName"));
- Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
Map<String, Object> propertyToUpdate = new HashMap<>();
@@ -140,7 +140,7 @@
public void testUpdateProperties_CurrentProfile_PROPS_TO_ADD() throws InterruptedException {
Profile profile = profileService.load(PROFILE_TEST_ID);
- Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
Map<String, Object> propertyToAdd = new HashMap<>();
@@ -169,7 +169,7 @@
@Test
public void testUpdateProperties_CurrentProfile_PROPS_TO_ADD_TO_SET() throws InterruptedException {
Profile profile = profileService.load(PROFILE_TEST_ID);
- Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
Map<String, Object> propertyToAddToSet = new HashMap<>();
@@ -196,7 +196,7 @@
propertyToAddToSet.put("properties.prop1", "New property 1 bis");
propertyToAddToSet.put("properties.prop3", "New property 3 bis");
- updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_ADD_TO_SET, propertyToAddToSet);
updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, PROFILE_TEST_ID);
@@ -216,7 +216,7 @@
@Test
public void testUpdateProperties_CurrentProfile_PROPS_TO_DELETE() throws InterruptedException {
Profile profile = profileService.load(PROFILE_TEST_ID);
- Event updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ Event updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
Map<String, Object> propertyToAdd = new HashMap<>();
@@ -242,7 +242,7 @@
List<String> propertyToDelete = new ArrayList<>();
propertyToDelete.add("properties.prop1bis");
- updateProperties = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ updateProperties = new Event("updateProperties", null, profile, null, null, null, new Date());
updateProperties.setPersistent(false);
updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_DELETE, propertyToDelete);
updateProperties.setProperty(UpdatePropertiesAction.TARGET_ID_KEY, PROFILE_TEST_ID);
diff --git a/itests/src/test/resources/schemas/events/test-event-type.json b/itests/src/test/resources/schemas/events/test-event-type.json
index 8d5a928..3a30f59 100644
--- a/itests/src/test/resources/schemas/events/test-event-type.json
+++ b/itests/src/test/resources/schemas/events/test-event-type.json
@@ -3,6 +3,7 @@
"$schema": "https://json-schema.org/draft/2019-09/schema",
"self":{
"vendor":"org.apache.unomi",
+ "target":"events",
"name":"testEventType",
"format":"jsonschema",
"target":"events",
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
index 0c29823..3d76d1b 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/IncrementInterestAction.java
@@ -89,7 +89,7 @@
final Map<String, Object> propertyToUpdate = new HashMap<>();
propertyToUpdate.put("properties.interests", profileInterestsMap);
- final Event updatePropertiesEvent = new Event("updateProperties", null, profile, null, null, profile, new Date());
+ final Event updatePropertiesEvent = new Event("updateProperties", null, profile, null, null, null, new Date());
updatePropertiesEvent.setProperty("update", propertyToUpdate);
return eventService.send(updatePropertiesEvent);
diff --git a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
index 23d2364..870159e 100644
--- a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
+++ b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
@@ -62,7 +62,7 @@
Map<String, Object> propertyToUpdate = new HashMap<>();
propertyToUpdate.put(propertyName, propertyValue);
- Event updateProperties = new Event("updateProperties", event.getSession(), event.getProfile(), event.getSourceId(), null, event.getProfile(), new Date());
+ Event updateProperties = new Event("updateProperties", event.getSession(), event.getProfile(), event.getSourceId(), null, null, new Date());
updateProperties.setPersistent(false);
updateProperties.setProperty(UpdatePropertiesAction.PROPS_TO_UPDATE, propertyToUpdate);
diff --git a/rest/src/main/java/org/apache/unomi/rest/deserializers/ContextRequestDeserializer.java b/rest/src/main/java/org/apache/unomi/rest/deserializers/ContextRequestDeserializer.java
index 38d0eb7..e435341 100644
--- a/rest/src/main/java/org/apache/unomi/rest/deserializers/ContextRequestDeserializer.java
+++ b/rest/src/main/java/org/apache/unomi/rest/deserializers/ContextRequestDeserializer.java
@@ -56,7 +56,7 @@
public ContextRequest deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException {
JsonNode node = jsonParser.getCodec().readTree(jsonParser);
// Validate schema on it
- if (!schemaService.isValid(node.toString(), "https://unomi.apache.org/schemas/json/contextrequest/1-0-0")) {
+ if (!schemaService.isValid(node.toString(), "https://unomi.apache.org/schemas/json/rest/requestIds/1-0-0")) {
throw new InvalidRequestException("Invalid Context request object", "Invalid received data");
}
ContextRequest cr = new ContextRequest();
diff --git a/rest/src/main/java/org/apache/unomi/rest/deserializers/EventsCollectorRequestDeserializer.java b/rest/src/main/java/org/apache/unomi/rest/deserializers/EventsCollectorRequestDeserializer.java
index 28b96fb..1bb272a 100644
--- a/rest/src/main/java/org/apache/unomi/rest/deserializers/EventsCollectorRequestDeserializer.java
+++ b/rest/src/main/java/org/apache/unomi/rest/deserializers/EventsCollectorRequestDeserializer.java
@@ -50,7 +50,7 @@
@Override
public EventsCollectorRequest deserialize(JsonParser jsonParser, DeserializationContext context) throws IOException, JsonProcessingException {
JsonNode node = jsonParser.getCodec().readTree(jsonParser);
- if (!schemaService.isValid(node.toString(), "https://unomi.apache.org/schemas/json/eventscollectorrequest/1-0-0")) {
+ if (!schemaService.isValid(node.toString(), "https://unomi.apache.org/schemas/json/rest/eventscollectorrequest/1-0-0")) {
throw new InvalidRequestException("Invalid events collector object", "Invalid received data");
}
diff --git a/rest/src/main/java/org/apache/unomi/rest/endpoints/ContextJsonEndpoint.java b/rest/src/main/java/org/apache/unomi/rest/endpoints/ContextJsonEndpoint.java
index 3f84bf1..91f6173 100644
--- a/rest/src/main/java/org/apache/unomi/rest/endpoints/ContextJsonEndpoint.java
+++ b/rest/src/main/java/org/apache/unomi/rest/endpoints/ContextJsonEndpoint.java
@@ -154,13 +154,9 @@
// Schema validation
ObjectNode paramsAsJson = JsonNodeFactory.instance.objectNode();
- if (personaId != null) {
- paramsAsJson.put("personaId", personaId);
- }
- if (sessionId != null) {
- paramsAsJson.put("sessionId", sessionId);
- }
- if (!schemaService.isValid(paramsAsJson.toString(), "https://unomi.apache.org/schemas/json/contextrequestparams/1-0-0")) {
+ paramsAsJson.put("personaId", personaId);
+ paramsAsJson.put("sessionId", sessionId);
+ if (!schemaService.isValid(paramsAsJson.toString(), "https://unomi.apache.org/schemas/json/rest/requestIds/1-0-0")) {
throw new InvalidRequestException("Invalid parameter", "Invalid received data");
}
Date timestamp = new Date();
diff --git a/rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java b/rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java
index 44612f1..ec1170c 100644
--- a/rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java
+++ b/rest/src/main/java/org/apache/unomi/rest/service/impl/RestServiceUtilsImpl.java
@@ -63,10 +63,11 @@
Cookie[] cookies = httpServletRequest.getCookies();
if (cookies != null) {
+ final Object profileIdCookieName = configSharingService.getProperty("profileIdCookieName");
for (Cookie cookie : cookies) {
- final Object profileIdCookieName = configSharingService.getProperty("profileIdCookieName");
if (profileIdCookieName.equals(cookie.getName())) {
- if (!schemaService.isValid(JsonNodeFactory.instance.objectNode().put("profileIdCookieName", cookie.getValue()).toString(), "https://unomi.apache.org/schemas/json/cookie/1-0-0")) {
+ String profileIdJSON = JsonNodeFactory.instance.objectNode().put("profileId", cookie.getValue()).toString();
+ if (!schemaService.isValid(profileIdJSON, "https://unomi.apache.org/schemas/json/rest/requestIds/1-0-0")) {
throw new InvalidRequestException("Invalid profile ID format in cookie", "Invalid received data");
}
cookieProfileId = cookie.getValue();
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json
deleted file mode 100644
index 8284e73..0000000
--- a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequest.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/contextrequest/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "ContextRequest",
- "type": "object",
- "properties": {
- "source": {
- "$ref": "https://unomi.apache.org/schemas/json/contextrequest/source/1-0-0"
- },
- "requireSegments": {
- "type": ["null", "boolean"]
- },
- "requiredProfileProperties": {
- "type": ["null", "array"],
- "items": {
- "type": "string"
- }
- },
- "requiredSessionProperties": {
- "type": ["null", "array"],
- "items": {
- "type": "string"
- }
- },
- "requireScores": {
- "type": ["null", "boolean"]
- },
- "events": {
- "type": ["null", "array"],
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0"
- }
- },
- "filters": {
- "type": ["null", "array"],
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/personalization/personalizedcontent/1-0-0"
- }
- },
- "personalizations": {
- "type": ["null", "array"],
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/personalization/personalizedrequest/1-0-0"
- }
- },
- "profileOverrides": {
- "$ref": "https://unomi.apache.org/schemas/json/profile/1-0-0"
- },
- "sessionPropertiesOverrides": {
- "type": ["null", "object"],
- "maxProperties": 50
- },
- "sessionId": {
- "type": ["null", "string"],
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- },
- "profileId": {
- "type": ["null", "string"],
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- },
- "clientId": {
- "type": ["null", "string"]
- }
- }
-}
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json
deleted file mode 100644
index 6e115f3..0000000
--- a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/contextrequestparams.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/contextrequestparams/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "ContextRequestParams",
- "type": "object",
- "properties": {
- "personaId" : {
- "type" : "string",
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- },
- "sessionId" : {
- "type" : "string",
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- }
- }
-}
\ No newline at end of file
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json b/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json
deleted file mode 100644
index 4265f70..0000000
--- a/rest/src/main/resources/META-INF/cxs/schemas/contextrequest/source/source.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/contextrequest/source/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Item",
- "type": "object",
- "properties" : {
- "itemId" : {
- "type" : ["null","string"],
- "pattern" : "^(\\w|[-_@\\./]){0,100}$",
- "description" : "The identifier for the item"
- },
- "itemType" : {
- "type" : "string",
- "description" : "The type for the item"
- },
- "scope" : {
- "type" : ["null","string"],
- "description" : "The item's scope"
- },
- "version" : {
- "type" : ["null","integer"],
- "minimum" : 0,
- "description" : "The item's version number"
- },
- "systemMetadata" : {
- "type" : ["null","object"],
- "description" : "Any system metadata for the item",
- "maxProperties" : 50
- }
- }
-}
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/cookie.json b/rest/src/main/resources/META-INF/cxs/schemas/cookie.json
deleted file mode 100644
index 1e82ada..0000000
--- a/rest/src/main/resources/META-INF/cxs/schemas/cookie.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/cookie/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "Cookie",
- "type": "object",
- "properties": {
- "profileIdCookieName" : {
- "type" : "string",
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- }
- }
-}
\ No newline at end of file
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json b/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json
deleted file mode 100644
index 781ff28..0000000
--- a/rest/src/main/resources/META-INF/cxs/schemas/eventscollectorrequest.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "$id": "https://unomi.apache.org/schemas/json/eventscollectorrequest/1-0-0",
- "$schema": "https://json-schema.org/draft/2019-09/schema",
- "title": "EventsCollectorRequest",
- "type": "object",
- "allOf": [
- {
- "$ref": "https://unomi.apache.org/schemas/json/item/1-0-0"
- }
- ],
- "properties": {
- "events" : {
- "type": ["array"],
- "items": {
- "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0"
- },
- "minItems": 1
- },
- "sessionId" : {
- "type": ["null", "string"],
- "pattern" : "^(\\w|[-_@\\.]){0,60}$"
- }
- }
-}
\ No newline at end of file
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/rest/eventscollectorrequest.json b/rest/src/main/resources/META-INF/cxs/schemas/rest/eventscollectorrequest.json
new file mode 100644
index 0000000..9828e95
--- /dev/null
+++ b/rest/src/main/resources/META-INF/cxs/schemas/rest/eventscollectorrequest.json
@@ -0,0 +1,22 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/rest/eventscollectorrequest/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "eventsCollectorRequest",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "EventsCollectorRequest",
+ "type": "object",
+ "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/rest/requestIds/1-0-0" }],
+ "properties": {
+ "events" : {
+ "type": ["array"],
+ "items": {
+ "type": "object"
+ },
+ "minItems": 1
+ }
+ }
+}
\ No newline at end of file
diff --git a/rest/src/main/resources/META-INF/cxs/schemas/rest/requestIds.json b/rest/src/main/resources/META-INF/cxs/schemas/rest/requestIds.json
new file mode 100644
index 0000000..366a795
--- /dev/null
+++ b/rest/src/main/resources/META-INF/cxs/schemas/rest/requestIds.json
@@ -0,0 +1,26 @@
+{
+ "$id": "https://unomi.apache.org/schemas/json/rest/requestIds/1-0-0",
+ "$schema": "https://json-schema.org/draft/2019-09/schema",
+ "self":{
+ "vendor":"org.apache.unomi",
+ "name": "contextRequest",
+ "format":"jsonschema",
+ "version":"1-0-0"
+ },
+ "title": "ContextRequest",
+ "type": "object",
+ "properties": {
+ "sessionId": {
+ "type": ["null", "string"],
+ "pattern" : "^(\\w|[-_@\\.]){0,60}$"
+ },
+ "profileId": {
+ "type": ["null", "string"],
+ "pattern" : "^(\\w|[-_@\\.]){0,60}$"
+ },
+ "personaId" : {
+ "type" : ["null", "string"],
+ "pattern" : "^(\\w|[-_@\\.]){0,60}$"
+ }
+ }
+}
diff --git a/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json b/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json
deleted file mode 100644
index ef8dab2..0000000
--- a/services/src/main/resources/META-INF/cxs/events/anonymizeProfile.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "type" : "anonymizeProfile",
- "propertyTypes" : [
- {
- "itemId": "target",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/articleCompleted.json b/services/src/main/resources/META-INF/cxs/events/articleCompleted.json
deleted file mode 100644
index 9e31662..0000000
--- a/services/src/main/resources/META-INF/cxs/events/articleCompleted.json
+++ /dev/null
@@ -1,77 +0,0 @@
-{
- "type" : "articleCompleted",
- "propertyTypes" : [
- {
- "itemId": "properties",
- "type": "set"
- },
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/form.json b/services/src/main/resources/META-INF/cxs/events/form.json
deleted file mode 100644
index 4551168..0000000
--- a/services/src/main/resources/META-INF/cxs/events/form.json
+++ /dev/null
@@ -1,77 +0,0 @@
-{
- "type" : "form",
- "propertyTypes" : [
- {
- "itemId": "properties",
- "type": "set"
- },
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/goal.json b/services/src/main/resources/META-INF/cxs/events/goal.json
deleted file mode 100644
index 11468cc..0000000
--- a/services/src/main/resources/META-INF/cxs/events/goal.json
+++ /dev/null
@@ -1,83 +0,0 @@
-{
- "type" : "goal",
- "propertyTypes" : [
- {
- "itemId" : "source",
- "type": "set"
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "campaignId",
- "type" : "string"
- },
- {
- "itemId" : "startEvent",
- "type" : "set"
- },
- {
- "itemId" : "targetEvent",
- "type" : "set"
- },
- {
- "itemId" : "metadata",
- "type" : "set",
- "childPropertyTypes" : [
- {
- "itemId": "id",
- "type": "string"
- },
- {
- "itemId": "name",
- "type": "string"
- },
- {
- "itemId": "description",
- "type": "string"
- },
- {
- "itemId": "scope",
- "type": "string"
- },
- {
- "itemId": "tags",
- "multivalued" : true,
- "type": "string"
- },
- {
- "itemId": "enabled",
- "type": "boolean"
- },
- {
- "itemId": "missingPlugins",
- "type": "boolean"
- },
- {
- "itemId": "hidden",
- "type": "boolean"
- },
- {
- "itemId": "readOnly",
- "type": "boolean"
- }
- ]
- }
- ]
- }
-
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/identify.json b/services/src/main/resources/META-INF/cxs/events/identify.json
deleted file mode 100644
index 1fb001d..0000000
--- a/services/src/main/resources/META-INF/cxs/events/identify.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "type": "identify",
- "propertyTypes": [
- {
- "itemId": "properties",
- "type": "set"
- },
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
diff --git a/services/src/main/resources/META-INF/cxs/events/incrementInterest.json b/services/src/main/resources/META-INF/cxs/events/incrementInterest.json
deleted file mode 100644
index 8604990..0000000
--- a/services/src/main/resources/META-INF/cxs/events/incrementInterest.json
+++ /dev/null
@@ -1,49 +0,0 @@
-{
- "type" : "incrementInterest",
- "propertyTypes" : [
- {
- "itemId": "properties",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId" : "interests",
- "type" : "set"
- }
- ]
- },
- {
- "itemId": "target",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/login.json b/services/src/main/resources/META-INF/cxs/events/login.json
deleted file mode 100644
index 4e66255..0000000
--- a/services/src/main/resources/META-INF/cxs/events/login.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "type": "login",
- "propertyTypes": [
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId": "target",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId": "itemId",
- "type": "string"
- },
- {
- "itemId": "itemType",
- "type": "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId": "scope",
- "type": "string"
- },
- {
- "itemId": "properties",
- "type": "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
diff --git a/services/src/main/resources/META-INF/cxs/events/modifyConsent.json b/services/src/main/resources/META-INF/cxs/events/modifyConsent.json
deleted file mode 100644
index 5eec0bf..0000000
--- a/services/src/main/resources/META-INF/cxs/events/modifyConsent.json
+++ /dev/null
@@ -1,105 +0,0 @@
-{
- "type" : "modifyConsent",
- "propertyTypes" : [
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId" : "target",
- "type" : "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId" : "properties",
- "type" : "set",
- "childPropertyTypes" : [
- {
- "itemId" : "consent",
- "type" : "set",
- "childPropertyTypes" : [
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "typeIdentifier",
- "type" : "string"
- },
- {
- "itemId" : "status",
- "type" : "string"
- },
- {
- "itemId" : "statusDate",
- "type" : "date"
- },
- {
- "itemId" : "revokeDate",
- "type" : "date"
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/profileDeleted.json b/services/src/main/resources/META-INF/cxs/events/profileDeleted.json
deleted file mode 100644
index 62fed55..0000000
--- a/services/src/main/resources/META-INF/cxs/events/profileDeleted.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "type" : "profileDeleted",
- "propertyTypes" : [
- {
- "itemId": "target",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/profileUpdated.json b/services/src/main/resources/META-INF/cxs/events/profileUpdated.json
deleted file mode 100644
index 78c675a..0000000
--- a/services/src/main/resources/META-INF/cxs/events/profileUpdated.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "type": "profileUpdated",
- "propertyTypes" : [
- {
- "itemId": "target",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
diff --git a/services/src/main/resources/META-INF/cxs/events/ruleFired.json b/services/src/main/resources/META-INF/cxs/events/ruleFired.json
deleted file mode 100644
index 2a0f4c6..0000000
--- a/services/src/main/resources/META-INF/cxs/events/ruleFired.json
+++ /dev/null
@@ -1,91 +0,0 @@
-{
- "type" : "ruleFired",
- "propertyTypes" : [
- {
- "itemId" : "source",
- "type": "set"
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "linkedItems",
- "type" : "string",
- "multivalued" : true
- },
- {
- "itemId" : "priority",
- "type" : "long"
- },
- {
- "itemId" : "raiseEventOnlyOnceForProfile",
- "type" : "boolean"
- },
- {
- "itemId" : "raiseEventOnlyOnceForSession",
- "type" : "boolean"
- },
- {
- "itemId" : "raiseEventOnlyOnce",
- "type" : "boolean"
- },
- {
- "itemId" : "metadata",
- "type" : "set",
- "childPropertyTypes" : [
- {
- "itemId": "id",
- "type": "string"
- },
- {
- "itemId": "name",
- "type": "string"
- },
- {
- "itemId": "description",
- "type": "string"
- },
- {
- "itemId": "scope",
- "type": "string"
- },
- {
- "itemId": "tags",
- "multivalued" : true,
- "type": "string"
- },
- {
- "itemId": "enabled",
- "type": "boolean"
- },
- {
- "itemId": "missingPlugins",
- "type": "boolean"
- },
- {
- "itemId": "hidden",
- "type": "boolean"
- },
- {
- "itemId": "readOnly",
- "type": "boolean"
- }
- ]
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/search.json b/services/src/main/resources/META-INF/cxs/events/search.json
deleted file mode 100644
index 94fb45c..0000000
--- a/services/src/main/resources/META-INF/cxs/events/search.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "type": "search",
- "propertyTypes": [
- {
- "itemId": "properties",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId": "originForm",
- "type": "string"
- },
- {
- "itemId": "language",
- "type": "string"
- },
- {
- "itemId": "keyword",
- "type": "string"
- },
- {
- "itemId": "origin",
- "type": "string"
- }
- ]
- },
- {
- "itemId": "target",
- "type": "set",
- "childPropertyTypes": [
- {
- "itemId": "itemId",
- "type": "string"
- },
- {
- "itemId": "itemType",
- "type": "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId": "scope",
- "type": "string"
- },
- {
- "itemId": "properties",
- "type": "set"
- }
- ]
- }
- ]
-}
diff --git a/services/src/main/resources/META-INF/cxs/events/sessionCreated.json b/services/src/main/resources/META-INF/cxs/events/sessionCreated.json
deleted file mode 100644
index 0d27647..0000000
--- a/services/src/main/resources/META-INF/cxs/events/sessionCreated.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "type" : "sessionCreated",
- "propertyTypes" : [
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "profileId",
- "type" : "string"
- },
- {
- "itemId" : "profile",
- "type" : "set"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId" : "systemProperties",
- "type" : "set"
- },
- {
- "itemId" : "lastEventDate",
- "type" : "date"
- },
- {
- "itemId" : "size",
- "type" : "long"
- },
- {
- "itemId" : "duration",
- "type" : "long"
- }
- ]
- }
-
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json b/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json
deleted file mode 100644
index d69801b..0000000
--- a/services/src/main/resources/META-INF/cxs/events/sessionReassigned.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "type" : "sessionReassigned",
- "propertyTypes" : [
- {
- "itemId" : "source",
- "type": "set"
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "profileId",
- "type" : "string"
- },
- {
- "itemId" : "profile",
- "type" : "set"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId" : "systemProperties",
- "type" : "set"
- },
- {
- "itemId" : "lastEventDate",
- "type" : "date"
- },
- {
- "itemId" : "size",
- "type" : "long"
- },
- {
- "itemId" : "duration",
- "type" : "long"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/services/src/main/resources/META-INF/cxs/events/updateProperties.json b/services/src/main/resources/META-INF/cxs/events/updateProperties.json
deleted file mode 100644
index 2be02f4..0000000
--- a/services/src/main/resources/META-INF/cxs/events/updateProperties.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "type": "updateProperties",
- "propertyTypes" : [
- {
- "itemId": "properties",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "targetId",
- "type" : "string"
- },
- {
- "itemId" : "targetType",
- "type" : "string"
- },
- {
- "itemId" : "add",
- "type" : "set"
- },
- {
- "itemId" : "update",
- "type" : "set"
- },
- {
- "itemId" : "delete",
- "type" : "set"
- }
- ]
- },
- {
- "itemId": "target",
- "type": "set"
- },
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
diff --git a/services/src/main/resources/META-INF/cxs/events/view.json b/services/src/main/resources/META-INF/cxs/events/view.json
deleted file mode 100644
index a07398f..0000000
--- a/services/src/main/resources/META-INF/cxs/events/view.json
+++ /dev/null
@@ -1,77 +0,0 @@
-{
- "type" : "view",
- "propertyTypes" : [
- {
- "itemId": "properties",
- "type": "set"
- },
- {
- "itemId" : "source",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- },
- {
- "itemId" : "target",
- "type": "set",
- "childPropertyTypes" : [
- {
- "itemId" : "itemId",
- "type" : "string"
- },
- {
- "itemId" : "itemType",
- "type" : "string"
- },
- {
- "itemId" : "customItemType",
- "type" : "string"
- },
- {
- "itemId" : "scope",
- "type" : "string"
- },
- {
- "itemId" : "properties",
- "type" : "set"
- },
- {
- "itemId": "version",
- "type": "long"
- },
- {
- "itemId": "systemMetadata",
- "type": "set"
- }
- ]
- }
- ]
-}
\ No newline at end of file