Simplify RPCMessageType schema definition

This commit is contained in:
Matthias
2023-06-29 12:08:52 +00:00
parent be07ea5d4f
commit 29725440c8

View File

@@ -112,6 +112,8 @@ MINIMAL_CONFIG = {
} }
} }
__MESSAGE_TYPE_DICT: Dict[str, Dict[str, str]] = {x: {'type': 'object'} for x in RPCMessageType}
# Required json-schema for user specified config # Required json-schema for user specified config
CONF_SCHEMA = { CONF_SCHEMA = {
'type': 'object', 'type': 'object',
@@ -354,7 +356,8 @@ CONF_SCHEMA = {
'format': {'type': 'string', 'enum': WEBHOOK_FORMAT_OPTIONS, 'default': 'form'}, 'format': {'type': 'string', 'enum': WEBHOOK_FORMAT_OPTIONS, 'default': 'form'},
'retries': {'type': 'integer', 'minimum': 0}, 'retries': {'type': 'integer', 'minimum': 0},
'retry_delay': {'type': 'number', 'minimum': 0}, 'retry_delay': {'type': 'number', 'minimum': 0},
**dict([(x, {'type': 'object'}) for x in RPCMessageType]), **__MESSAGE_TYPE_DICT,
# **{x: {'type': 'object'} for x in RPCMessageType},
# Below -> Deprecated # Below -> Deprecated
'webhookentry': {'type': 'object'}, 'webhookentry': {'type': 'object'},
'webhookentrycancel': {'type': 'object'}, 'webhookentrycancel': {'type': 'object'},