Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add com.snowplowanalytics.snowplow/recoveries/jsonschema/4-1-0 (close #1214) #1215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions schemas/com.snowplowanalytics.snowplow/recoveries/jsonschema/4-1-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
{
"$schema": "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#",
"description": "Schema for an array of recovery scenarios",
"self": {
"vendor": "com.snowplowanalytics.snowplow",
"name": "recoveries",
"format": "jsonschema",
"version": "4-1-0"
},
"type": "object",
"minProperties": 1,
"patternProperties": {
"^iglu:": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^(([a-zA-Z0-9]+)(-?))+$",
"minLength": 1,
"description": "A slug name for recovery flow"
},
"conditions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"op": {
"type": "string",
"enum": [
"Test"
],
"description": "Transformation operation to perform"
},
"path": {
"type": "string",
"description": "JSON Path to object"
},
"match": {
"type": "string",
"description": "An expression applied when replacing field’s values with new value"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"description": "Compare against static value",
"properties": {
"value": {
"type": [
"array",
"number",
"object",
"string"
]
}
},
"required": [
"value"
],
"additionalProperties": false
},
{
"type": "object",
"description": "Compare against regular expression",
"properties": {
"regex": {
"type": "string"
}
},
"required": [
"regex"
],
"additionalProperties": false
},
{
"type": "object",
"description": "Compare size",
"properties": {
"size": {
"type": "object",
"oneOf": [
{
"properties": {
"eq": {
"type": "integer"
}
},
"required": [
"eq"
],
"additionalProperties": false
},
{
"properties": {
"lt": {
"type": "integer"
}
},
"required": [
"lt"
],
"additionalProperties": false
},
{
"properties": {
"gt": {
"type": "integer"
}
},
"required": [
"gt"
],
"additionalProperties": false
}
]
}
},
"additionalProperties": false
}
],
"description": "A value to match against"
},
"from": {
"type": "string",
"description": "Source type to cast from"
},
"to": {
"type": "string",
"description": "Target type to cast to"
}
},
"required": [
"op",
"path"
],
"additionalProperties": false
},
"description": "Conditions required to apply steps for specific Bad Row type"
},
"steps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"op": {
"type": "string",
"enum": [
"Add",
"Cast",
"Remove",
"Replace"
],
"description": "Transformation operation to perform"
},
"path": {
"type": "string",
"description": "JSON Path to object"
},
"match": {
"type": "string",
"description": "An expression applied when replacing field’s values with new value"
},
"value": {
"type": [
"array",
"boolean",
"null",
"number",
"object",
"string"
],
"description": "Replace static value"
},
"from": {
"type": "string",
"description": "Source type to cast from"
},
"to": {
"type": "string",
"description": "Target type to cast to"
}
},
"required": [
"op",
"path"
],
"additionalProperties": false
},
"description": "Steps to be applied for specific Bad Row type"
}
},
"required": [
"name",
"conditions",
"steps"
]
}
}
}
}