How to create a valid self-describing json schema for snowplow mini

Hi there,

I’ve set up a Snowplow mini (back to the 0.6.0 version) instance, and would like to send some custom events to it from a Java tracker. However, I’m stuck at creating the right self-describing json schema, it won’t validate with the igluctl lint command.
If I run the command, response is “JSON schema in [schemas\paap_dev_event.json] does not correspond to its metadata [iglu:com.planonsoftware/paap_dev_event/jsonschema/1-0-0]”. My paap_dev_event.json looks like this:
{
“$schema”: “http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#”,
“description”: “paap_dev_event”,
“self”: {
“vendor”: “com.planonsoftware”,
“name”: “paap_dev_event”,
“format”: “jsonschema”,
“version”: “1-0-0”
},
“type”: “object”,
“properties”: {
“category”: {
“type”: “string”,
“maxLength”: 100,
“description”: “event category”
},
“action”: {
“type”: “string”,
“maxLength”: 100,
“description”: “the action that was performed by the actor”
},
“label”: {
“type”: “string”,
“maxLength”: 255,
“description”: “a string to provide additional dimensions to the event data”
},
“workspaceId”: {
“type”: “string”,
“description”: “workspace id”
},
“session”: {
“type”: “string”,
“maxLength”: 36,
“description”: “IDE session uuid”
}
},
“required”: [“category”,“action”,“session”,“workspaceId”],
“additionalProperties”:false
}

What am I doing wrong?

the json itself is actually fine because I can post it to the Iglu server through the rest API and custom events using the schema end up in the ‘good’ event stream.

Hi @Anske,

The directory structure you use to house the schemas should match the self portion of the JSON:

“vendor”: “com.planonsoftware”,
“name”: “paap_dev_event”,
“format”: “jsonschema”,
“version”: “1-0-0”

Where 1-0-0 is a file with no extension. So your schema will lint properly if saved in a file named 1-0-0 at this location:

schemas/com.planonsoftware/paap_dev_event/jsonschema/1-0-0.

Ah okee, thanks, they now validate…I had the right folder structure initially (except for my deepest folder being the 1-0-0), but didn’t realize 1-0-0 being the filename…

1 Like