Refactor human readable errors for webhooks

This commit is contained in:
amcmanu3 2024-08-06 14:08:49 -04:00
parent 2de9c90924
commit 5c9b59f9e8
2 changed files with 70 additions and 12 deletions

View File

@ -16,16 +16,45 @@ new_webhook_schema = {
"webhook_type": {
"type": "string",
"enum": WebhookFactory.get_supported_providers(),
"error": "typeString",
"fill": True,
},
"name": {
"type": "string",
"error": "typeString",
"fill": True,
},
"url": {
"type": "string",
"error": "typeString",
"fill": True,
},
"bot_name": {
"type": "string",
"error": "typeString",
"fill": True,
},
"trigger": {
"type": "array",
"error": "typeString",
"fill": True,
},
"body": {
"type": "string",
"error": "typeString",
"fill": True,
},
"color": {
"type": "string",
"default": "#005cd1",
"error": "typeString",
"fill": True,
},
"name": {"type": "string"},
"url": {"type": "string"},
"bot_name": {"type": "string"},
"trigger": {"type": "array"},
"body": {"type": "string"},
"color": {"type": "string", "default": "#005cd1"},
"enabled": {
"type": "boolean",
"default": True,
"error": "typeBool",
"fill": True,
},
},
"additionalProperties": False,

View File

@ -17,16 +17,45 @@ webhook_patch_schema = {
"webhook_type": {
"type": "string",
"enum": WebhookFactory.get_supported_providers(),
"error": "typeString",
"fill": True,
},
"name": {
"type": "string",
"error": "typeString",
"fill": True,
},
"url": {
"type": "string",
"error": "typeString",
"fill": True,
},
"bot_name": {
"type": "string",
"error": "typeString",
"fill": True,
},
"trigger": {
"type": "array",
"error": "typeString",
"fill": True,
},
"body": {
"type": "string",
"error": "typeString",
"fill": True,
},
"color": {
"type": "string",
"default": "#005cd1",
"error": "typeString",
"fill": True,
},
"name": {"type": "string"},
"url": {"type": "string"},
"bot_name": {"type": "string"},
"trigger": {"type": "array"},
"body": {"type": "string"},
"color": {"type": "string", "default": "#005cd1"},
"enabled": {
"type": "boolean",
"default": True,
"error": "typeBool",
"fill": True,
},
},
"additionalProperties": False,