summaryrefslogtreecommitdiff
path: root/src/schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/schema.py')
-rw-r--r--src/schema.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/schema.py b/src/schema.py
index fe2b76c..2b479d2 100644
--- a/src/schema.py
+++ b/src/schema.py
@@ -1,3 +1,4 @@
+from typing import List, Any, Dict
import json
import sys
import traceback
@@ -95,15 +96,15 @@ schema = {
# fmt:on
-def get_index_keys():
- keys = list()
+def get_index_keys() -> List[str]:
+ keys: List[str] = []
for key in schema["properties"]:
keys.append(key)
return keys
-def as_index_list():
- index_list = list()
+def as_index_list() -> List[Dict[str, Any]]:
+ index_list: List[Dict[str, Any]] = []
for key in schema["properties"]:
name = f"{key}-json-index"
index = {
@@ -120,7 +121,7 @@ def as_index_list():
return index_list
-def validate_collector_data(json_blob):
+def validate_collector_data(json_blob: Dict[str, Any]) -> str:
try:
jsonschema.validate(json_blob, schema, format_checker=jsonschema.FormatChecker())
except jsonschema.exceptions.ValidationError as e: