Error with array datatype

HI!

We already using SP. And we are using custom (unstructured) events.
And we have already used arrays in event parameters.
Everything was fine and after 15 of June we have this kind of error.
Shema does exist.

“errors”:[{“level”:“error”,“message”:"error: Could not find schema with key iglu:ru.napolke.sp/banner_click/jsonschema/1-0-0 in any repository, tried:\n

level: “error”\n repositories: [“Local cached IGLU repository mirror [HTTP]”,“Iglu Client Embedded [embedded]”,“Custom schemas IGLU repository [HTTP]”]\n"},{“level”:“error”,“message”:"error: “array(string)” is not a valid primitive type (valid values are: [array, boolean, integer, null, number, object, string])\n

level: “error”\n domain: “syntax”\n schema: {“loadingURI”:"#",“pointer”:"/properties/brand_id"}\n keyword: “type”\n found: “array(string)”\n valid: [“array”,“boolean”,“integer”,“null”,“number”,“object”,“string”]\n"},{“level”:“error”,“message”:"error: “array(string)” is not a valid primitive type (valid values are: [array, boolean, integer, null, number, object, string])\n

We are using Crate DB.

Sсhema:

{
“$schema”: “https://sp.napolke.ru/schemas/ru.napolke.sp/banner_click/jsonschema/1-0-0”,
“description”: “Napolke snowplow autogenerated schema”,
“self”: {
“vendor”: “ru.napolke.sp”,
“name”: “banner_click”,
“format”: “jsonschema”,
“version”: “1-0-0”
},
“type”: “object”,
“properties”: {
“banner_name”: {
“type”: “array(string)”
},
“banner_size”: {
“type”: “array(string)”
},
“banner_tracker”: {
“type”: “array(string)”
},
“banner_shape”: {
“type”: “array(string)”
},
“supplier_id”: {
“type”: “array(string)”
},
“category_id”: {
“type”: “array(string)”
},
“brand_id”: {
“type”: “array(string)”
},
“catalog_id”: {
“type”: “array(string)”
}
},
“additionalProperties”: false
}

Hi @rodion_zhukov,

I can see a couple of things to fix - first up, you need to use JSONSchema to define your types - here are the JSONSchema docs on arrays. For an array of strings it should be:

{
  "type": "array",
  "items": {
    "type": "string"
  }
}

Second, the $schema field in your schema shouldn’t refer to the path of the schema itself (although it seems this way intuitively). Instead it should refer to the path to the metaschema for Self-describing JSON:

"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#"

Hope that helps!

4 Likes