I have unstructed event schema and it does not accept incoming event. Error that I get:
object instance has properties which are not allowed by the schema: ["offer","paymentMethod"]\n level: "error"\n schema: {"loadingURI":"#","pointer":""}\n instance: {"pointer":""}\n domain: "validation"\n keyword: "additionalProperties"\n unwanted: ["offer","paymentMethod"]\n"
Schema:
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Schema for subscription purchase event",
"self": {
"vendor": "com.custom",
"name": "purchase",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"coupon": {
"description": "Applied coupon",
"type": ["string", "null"],
"maxLength": 255
},
"couponValue": {
"description": "The nominal of the discount in $",
"type": ["number", "null"],
"minimum": 0,
"maximum": 2147483647
},
"subscriptionId": {
"description": "subscriptionID",
"type": ["integer", "null"],
"minimum": 0,
"maximum": 9223372036854775807
},
"purchaseValue": {
"description": "Price in $",
"type": ["number", "null"],
"minimum": 0,
"maximum": 2147483647
},
"subscriptionType": {
"description": "Subscription type",
"type": ["string", "null"],
"maxLength": 100
},
"subscriptionPlan": {
"description": "Subscription plan",
"type": ["string", "null"],
"maxLength": 100
},
"paymentMethod": {
"description": "Payment type",
"type": ["string", "null"],
"maxLength": 100
},
"offer": {
"description": "Offer applied during subscription",
"type": ["string", "null"],
"maxLength": 100
}
},
"required": ["subscriptionId", "purchaseValue", "subscriptionType", "subscriptionPlan", "paymentMethod"],
"additionalProperties": false
}
Incoming event:
{"subscriptionPlan":"1","purchaseValue":14.95,"subscriptionId":12345,"subscriptionType":"order","paymentMethod":"Card","offer":"order"}
Why do not accepted offer and paymentMethod fields? They are no required. From my perspective it should be ok. Chrome snowplow plugin also mark such event as valid.