Skip to content

Commit

Permalink
Add com.snowplowanalytics.snowplow/recoveries/jsonschema/4-1-0 (close #…
Browse files Browse the repository at this point in the history
  • Loading branch information
peel committed May 31, 2022
1 parent 534d52e commit b30f1bc
Showing 1 changed file with 205 additions and 0 deletions.
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"
]
}
}
}
}

0 comments on commit b30f1bc

Please sign in to comment.